Nebula
|
#include <posixtimer.h>
Posix implementation of the Time::Timer class.
Under Posix, time measurement uses the QueryPerformanceCounter() methods.
(C) 2006 Radon Labs GmbH (C) 2013-2018 Individual contributors, see AUTHORS file
Public Member Functions | |
PosixTimer () | |
constructor | |
void | Start () |
start/continue the timer | |
void | Stop () |
stop the timer | |
void | Reset () |
reset the timer | |
bool | Running () const |
return true if currently running | |
Timing::Time | GetTime () const |
get current time in seconds | |
Timing::Tick | GetTicks () const |
get current time in ticks | |
Private Member Functions | |
Timing::Time | InternalTime () const |
return internal time | |
Timing::Time | ToTime (const timespec &ts) const |
Convert timespec to Timing::Time. | |
Private Attributes | |
bool | running |
Timing::Time | diffTime |
Timing::Time | stopTime |
Posix::PosixTimer::PosixTimer | ( | ) |
constructor
Timing::Tick Posix::PosixTimer::GetTicks | ( | ) | const |
get current time in ticks
This returns the timer's current time in "ticks".
Timing::Time Posix::PosixTimer::GetTime | ( | ) | const |
get current time in seconds
This returns the timer's current time in seconds.
|
private |
return internal time
This returns the internal local time as large integer.
void Posix::PosixTimer::Reset | ( | ) |
reset the timer
Reset the timer so that will start counting at zero again.
bool Posix::PosixTimer::Running | ( | ) | const |
return true if currently running
Returns true if the timer is currently running.
void Posix::PosixTimer::Start | ( | ) |
start/continue the timer
Start the timer.
This will update the diffTime member to reflect the accumulated time when the timer was not running (basically the difference between this timer's time and the real system time).
void Posix::PosixTimer::Stop | ( | ) |
|
private |
Convert timespec to Timing::Time.
|
private |
|
private |
|
private |