#include <Timer.hh>
Public Member Functions | |
Timer () | |
Default constructor. | |
void | start () |
Starts the clock without resetting it. | |
void | stop () |
Stops the clock (can be restarted). | |
void | snapshot () |
Records the current time between start and this function call. | |
void | reset () |
Reset the clock. | |
clock_t | real_ticks () const |
Real time in ticks. | |
clock_t | user_ticks () const |
CPU time in ticks. | |
clock_t | sys_ticks () const |
System time in ticks. | |
clock_t | user_sys_ticks () const |
Total (CPU plus system) time in ticks. | |
float | real_sec () const |
Real time in seconds. | |
float | user_sec () const |
CPU time in seconds. | |
float | sys_sec () const |
System time in seconds. | |
float | user_sys_sec () const |
Total (CPU plus sytem) time in seconds. | |
Protected Attributes | |
clock_t | m_final_real_ticks |
clock_t | m_final_user_ticks |
clock_t | m_final_sys_ticks |
clock_t | m_temp_real_ticks |
clock_t | m_temp_user_ticks |
clock_t | m_temp_sys_ticks |
clock_t | m_real_start |
clock_t | m_user_start |
clock_t | m_sys_start |
long | m_ticks_per_sec |
bool | m_running |
If ticks or seconds are needed while the timer is running, call snapshot() first, and then request ticks or seconds WHILE the timer is still running. After stop() call, the functions always return the stop time.
|
Default constructor.
|
|
Real time in seconds.
|
|
Real time in ticks.
|
|
Reset the clock.
|
|
Records the current time between start and this function call.
|
|
Starts the clock without resetting it.
|
|
Stops the clock (can be restarted).
|
|
System time in seconds.
|
|
System time in ticks.
|
|
CPU time in seconds.
|
|
Total (CPU plus sytem) time in seconds.
|
|
Total (CPU plus system) time in ticks.
|
|
CPU time in ticks.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|