#include <Timer.h>
Public Types | |
| typedef float | TimeType |
| This is the underlying type of the timer. | |
Public Member Functions | |
| Timer (bool const pause=false) | |
| Creates a new timer. | |
| ~Timer () | |
| void | pause (bool const pause=true) |
| Pauses and unpauses the timer. | |
| void | reset (bool const pause=false) |
| Resets the timer to 0. | |
| TimeType const | getElapsedTime () |
| bool const | isPaused () const |
The timer provides at least microsecond resolution. On Windows the QueryPerformanceCounter function is used. On Linux the gettimeofday function is used.
| typedef float PWToolBox::Timer::TimeType |
This is the underlying type of the timer.
| PWToolBox::Timer::Timer | ( | bool const | pause = false |
) |
Creates a new timer.
The timer is high-precision, with at least microsecond resolution.
| pause | If paused is true, the timer will not begin until pause(false) is called |
| Throws | IllegalOperationException if the timer cannot be initialized |
| PWToolBox::Timer::~Timer | ( | ) | [inline] |
| void PWToolBox::Timer::pause | ( | bool const | pause = true |
) |
Pauses and unpauses the timer.
There is no effect if the timer is already in the target state.
| pause | true will pause the timer, false will unpause it |
| void PWToolBox::Timer::reset | ( | bool const | pause = false |
) |
Resets the timer to 0.
| pause | If paused is true, the timer will not begin until pause(false) is called |
| TimeType const PWToolBox::Timer::getElapsedTime | ( | ) |
| bool const PWToolBox::Timer::isPaused | ( | ) | const [inline] |
true if the timer is paused
1.5.1