OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Timer.h
Go to the documentation of this file.
1 #ifndef TIMER_H
2 #define TIMER_H
3 
4 #include <boost/timer/timer.hpp>
5 
6 // https://www.boost.org/doc/libs/1_70_0/libs/timer/doc/cpu_timers.html
7 class Timer
8 {
9 public:
10 
11  Timer();
12 
13  void clear(); // Set all accumulated times to 0
14  void start(); // Start timer
15  void stop(); // Stop timer
16 
17  double clock_time(); // Report clock time accumulated in seconds
18  double user_time(); // Report user time accumlated in seconds
19  double system_time(); // Report system time accumulated in seconds
20  double cpu_time(); // Report total cpu_time which is just user_time + system_time
21 
22 private:
23  double wall_m;
24  double user_m;
25  double sys_m;
26  boost::timer::cpu_timer timer_m;
27 };
28 
29 #endif
double sys_m
Definition: Timer.h:25
Definition: Timer.h:7
Timer()
Definition: Timer.cpp:3
double user_m
Definition: Timer.h:24
double wall_m
Definition: Timer.h:23
double user_time()
Definition: Timer.cpp:34
void stop()
Definition: Timer.cpp:18
double system_time()
Definition: Timer.cpp:39
boost::timer::cpu_timer timer_m
Definition: Timer.h:26
void clear()
Definition: Timer.cpp:8
double clock_time()
Definition: Timer.cpp:29
double cpu_time()
Definition: Timer.cpp:44
void start()
Definition: Timer.cpp:13