Collaboration diagram for col::NanoTimer:
Timers, timing, sleeping, etc.
|Create a new timer with nanoseconds resolution. |
|Save the current time (stamp) in the timer. |
|double||elapsed (void) const|
|Return the time elapsed since the last start() in nanoseconds. |
|static bool||usesHighFrequ (void)|
|Tells whether or not the NanoTimer use the high frequency counter. |
|static double||frequ (void)|
|Returns the frequency (resolution) of the counter in GHz. |
The units of this timer are always nanoseconds, but on some platforms, the actual resolution might be less (microseconds or even less).
Where implemented, this class uses the high-speed, high-performance, hardware timers/counters. Otherwise, we just use gettimeofday(), which, at least on Linux/Pentium, has microsecond resolution.
Currently, the time is wall-clock time, not user time!
Create a new timer with nanoseconds resolution.
Saves the current time stamp, too.
Returns the frequency (resolution) of the counter in GHz.