Public Member Functions | List of all members
ibis::horometer Class Reference

Horometer – a primitive timing instrument. More...

#include <horometer.h>

Public Member Functions

double CPUTime () const
 Return the CPU time in seconds.
 
double realTime () const
 Return the elapsed time in seconds.
 
void resume ()
 Continue after being stopped.
 
void start ()
 Start the timer. Clear the internal counters.
 
void stop ()
 Stop the timer. Record the duration. May resume later.
 

Detailed Description

Horometer – a primitive timing instrument.

This is intented to be a simple timer that measures a single duration. It must be explicitly started by calling the function start. The same function start may be called to restart the timer which will discard the previous starting point. The function stop must be called before functions realTime and CPUTime can report correct time values. After a horometer is stopped, it may continue by calling start to count a new duration, or it may add to the existing duration by calling resume.

The timing accuracy depends on the underlying implementation. On most unix systems, the CPU time resolution is about 0.01 seconds, while the elapsed time may be accurate to 0.0001 seconds. The timing function itself may take ~10,000 clock cycles to execute, which is about 25 microseconds on a 400 MHz machine. This can become a significant source of error if a timer is stopped and resumed at a high frequency.


The documentation for this class was generated from the following file:

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive