ModErn Text Analysis
META Enumerates Textual Applications
time.h
Go to the documentation of this file.
1 
10 #ifndef META_UTIL_TIME_H_
11 #define META_UTIL_TIME_H_
12 
13 #include <chrono>
14 
15 namespace meta
16 {
17 namespace common
18 {
19 
26 template <class Duration = std::chrono::milliseconds, class Functor>
27 Duration time(Functor&& functor)
28 {
29  auto start = std::chrono::steady_clock::now();
30  functor();
31  auto end = std::chrono::steady_clock::now();
32  return std::chrono::duration_cast<Duration>(end - start);
33 }
34 }
35 }
36 
37 #endif
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition: analyzer.h:24