MinLCA algorithms
timer.hh
Go to the documentation of this file.
1 #ifndef __MINLCA_UTILS_TIMER_HH
2 #define __MINLCA_UTILS_TIMER_HH
3 #include <chrono>
4 
7 
8 namespace minlca
9 {
10 namespace utils
11 {
12 
14 class Timer
15 {
16 protected:
18  std::chrono::time_point<std::chrono::high_resolution_clock> _start;
19 
20 public:
22  Timer();
23 
25  void restart();
26 
30  double elapsed() const;
31 };
32 }
33 }
34 
35 #endif
Default namespace Default namespace for MinLCA algorithms.
Definition: base.hh:15
std::chrono::time_point< std::chrono::high_resolution_clock > _start
Instant when the timer is started.
Definition: timer.hh:18
Simple timing class.
Definition: timer.hh:14
double elapsed() const
Retrieve elapsed time.
Definition: timer.cc:20
void restart()
Restart the timer.
Definition: timer.cc:15
Timer()
Default constructor.
Definition: timer.cc:11