#include <Timer.h>
Public Member Functions | |
Timer (bool startNow=true) | |
Creates a new Timer object. | |
void | start () |
Start the timer. | |
void | stop () |
Stop the timer. | |
unsigned long long | elapsed () const |
Returns the amount of time that has elapsed since the timer was last started, in miliseconds. | |
void | wait (unsigned long long time) const |
Wait until time miliseconds have elapsed since the timer was last started. |
This timer support miliseconds-resolution, but the exact resolution depends on the OS and the hardware.
This class is thread-safe.
Timer timer; sleep(10); timer.elapsed(); // => about 10000 (msec)
Passenger::Timer::Timer | ( | bool | startNow = true |
) | [inline] |
unsigned long long Passenger::Timer::elapsed | ( | ) | const [inline] |
Returns the amount of time that has elapsed since the timer was last started, in miliseconds.
If the timer is currently stopped, then 0 is returned.
void Passenger::Timer::start | ( | ) | [inline] |
Start the timer.
If the timer was already started, then this will restart the timer.
void Passenger::Timer::stop | ( | ) | [inline] |