Nebula
Loading...
Searching...
No Matches
Darwin::DarwinTimer Class Reference

#include <darwintimer.h>

Detailed Description

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
 

Constructor & Destructor Documentation

◆ DarwinTimer()

Darwin::DarwinTimer::DarwinTimer ( )

constructor

Member Function Documentation

◆ GetTicks()

uint Darwin::DarwinTimer::GetTicks ( ) const

get current time in ticks

This returns the timer's current time in "ticks".

◆ GetTime()

Timing::Time Darwin::DarwinTimer::GetTime ( ) const

get current time in seconds

This returns the timer's current time in seconds.

◆ InternalTime()

uint64_t Darwin::DarwinTimer::InternalTime ( ) const
private

return internal time as 64 bit integer

This returns the internal local time as large integer.

◆ Reset()

void Darwin::DarwinTimer::Reset ( )

reset the timer

Reset the timer so that will start counting at zero again.

◆ Running()

bool Darwin::DarwinTimer::Running ( ) const

return true if currently running

Returns true if the timer is currently running.

◆ Start()

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).

◆ Stop()

void Darwin::DarwinTimer::Stop ( )

stop the timer

Stop the timer.

This will record the current realtime, so that the next Start() can measure the time lost between Stop() and Start() which must be taken into account to keep track of the difference between this timer's time and realtime.

Member Data Documentation

◆ diffTime

uint64_t Darwin::DarwinTimer::diffTime
private

◆ running

bool Darwin::DarwinTimer::running
private

◆ stopTime

uint64_t Darwin::DarwinTimer::stopTime
private

The documentation for this class was generated from the following files: