CVD 0.8
|
Provides the time elapsed in seconds. More...
#include <timer.h>
Public Member Functions | |
cvd_timer () | |
cvd_timer (double start) | |
double | get_time () |
double | conv_ntime (signed long long time) |
double | conv_ntime (const struct timeval &tv) |
double | conv_ntime (const double &time) const |
double | reset () |
void | reset (const double t) |
void | reset_ns (long long t) |
Provides the time elapsed in seconds.
This predominantly a wrapper for the system call gettimeofday(), but can also provides a convenient way of converting from other time units. In all cases, the time is given relative to the time the class was created, or the last time reset() was called.
double CVD::cvd_timer::conv_ntime | ( | signed long long | time | ) |
Convert the current time from units of nanoseconds into a double, correcting for the start time.
time | The current time in nanoseconds |
double CVD::cvd_timer::conv_ntime | ( | const struct timeval & | tv | ) |
Convert the current time from a timeval into a double, correcting for the start time.
tv | The current time as a timeval |
double CVD::cvd_timer::conv_ntime | ( | const double & | time | ) | const [inline] |
void CVD::cvd_timer::reset | ( | const double | t | ) |
Sets the start time to a specified time.
t | zero relative to the Epoch. |
void CVD::cvd_timer::reset_ns | ( | long long | t | ) |
Sets the start time to a specified time.
t | zero relative to the Epoch. |