Timer

Class capable of keeping track of time.  Time is returned in double format, in seconds.

Summary
Class capable of keeping track of time.
Initializes timer, timer is running starting at it’s creation.
Virtual destructor, does nothing, exists only to make Timer inheritance safe.
Reset timer to 0, will unpause timer if paused.
Pause timer.
Unpause timer if paused.
Get time in seconds.
Check paused/unpaused status of timer.

(Con/ De)structors

Timer

Timer(bool appTimeLinked = true)

Initializes timer, timer is running starting at it’s creation.  If this is not desired behavior call reset when you want it to start.

Parameters

appTimeLinkedOption only available on creation of timer.  When true timer will pause when the <Application::timer> is paused.  [default: true]

~Timer

virtual ~Timer()

Virtual destructor, does nothing, exists only to make Timer inheritance safe.

General

reset

void reset()

Reset timer to 0, will unpause timer if paused.

pause

void pause()

Pause timer.

unpause

void unpause()

Unpause timer if paused.

Accessors

getTime

double getTime() const

Get time in seconds.  (ie.  A value of .001 means 1 millisecond.)

Returns

Time on timer, in seconds.

isPaused

bool isPaused() const

Check paused/unpaused status of timer.

Returns

True if timer is paused, false if timer is running.

Timer(bool appTimeLinked = true)
Initializes timer, timer is running starting at it’s creation.
virtual ~Timer()
Virtual destructor, does nothing, exists only to make Timer inheritance safe.
void reset()
Reset timer to 0, will unpause timer if paused.
void pause()
Pause timer.
void unpause()
Unpause timer if paused.
double getTime() const
Get time in seconds.
bool isPaused() const
Check paused/unpaused status of timer.