11 #include <sys/times.h>
28 timer(): start_time(0), stop_time(0) {}
double start_time
last time the timer was started
Definition: profiling.hpp:24
double stop_time
last time the timer was stopped
Definition: profiling.hpp:25
double get_cycles()
get the number of cycles this program has gone through
Definition: profiling.hpp:15
double seconds_passed() const
return the number of seconds passed between last start and last stop (see cycles_passed()) ...
Definition: profiling.hpp:57
void pause()
pause the timer (= stop())
Definition: profiling.hpp:41
a simple timer class that can be paused and resumed
Definition: profiling.hpp:23
void resume()
resume the timer by setting an artificial start_time
Definition: profiling.hpp:46
void stop()
stop the timer
Definition: profiling.hpp:36
void start()
start the timer
Definition: profiling.hpp:31
double cycles_passed() const
return the number of cycles passed between last start and last stop
Definition: profiling.hpp:52
timer()
constructor
Definition: profiling.hpp:28