Simple timer class that allows to measure elapsed times in real seconds as well as CPU used sec
Simple timer class that allows to measure elapsed times in real seconds as well as CPU used sec. (pirated from CUJ)Note that the Chronograph keeps track of the CPU seconds as well as the real seconds passed. Thus one can use it for measureing the actual time a piece of code takes as well as the number of seconds that it takes in total.
USAGE:
Chronograph *my_chrono = new Chronograph(); // do something my_chrono->stop(); double nSecCpu = my_chrono->elapsed(); double nSecTotal = my_chrono->time_interval(); my_chrono->start(); // note start also resets the Chronograph // etc etcMODIFICATIONS :
- Dec 14, 1997: add #ifdef IRIX as IRIX 5.3 does not support CLOCK_REALTIME
- Mar 21, 1998: check that it works on Linux
~Chronograph()
starting and stopping the chronograph
getting the time information of the chronograph
double lap()
double elapsed()
double time_interval()
double elapsedHMS(double &Hours, double &Mins, double &Secs)
clock_t _start
clock_t _stopped
clock_t _lastlap
double _elapsed
struct timespec _start_time
double diff(clock_t start, clock_t end)
this page has been generated automatically by doc++
(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de