Nebula
|
#include <darwintimer.h>
Darwin implementation of the Time::Timer class.
Under Darwin, time measurement uses the mach_absolute_time() methods.
(C) 2006 Radon Labs GmbH (C) 2013-2018 Individual contributors, see AUTHORS file
Public Member Functions | |
DarwinTimer () | |
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 | |
uint | GetTicks () const |
get current time in ticks | |
Private Member Functions | |
uint64_t | InternalTime () const |
return internal time as 64 bit integer | |
Private Attributes | |
bool | running |
uint64_t | diffTime |
uint64_t | stopTime |
Darwin::DarwinTimer::DarwinTimer | ( | ) |
constructor
uint Darwin::DarwinTimer::GetTicks | ( | ) | const |
get current time in ticks
This returns the timer's current time in "ticks".
Timing::Time Darwin::DarwinTimer::GetTime | ( | ) | const |
get current time in seconds
This returns the timer's current time in seconds.
|
private |
return internal time as 64 bit integer
This returns the internal local time as large integer.
void Darwin::DarwinTimer::Reset | ( | ) |
reset the timer
Reset the timer so that will start counting at zero again.
bool Darwin::DarwinTimer::Running | ( | ) | const |
return true if currently running
Returns true if the timer is currently running.
void Darwin::DarwinTimer::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 Darwin::DarwinTimer::Stop | ( | ) |
|
private |
|
private |
|
private |