Polycode
Polycode::Timer Class Reference

A timer that dispatches trigger events. More...

Inherits Polycode::EventDispatcher.

List of all members.

Public Member Functions

 Timer (bool triggerMode, int msecs)
 Creates a new timer.
void Pause (bool paused)
 Pauses and resumes the timer.
bool isPaused ()
 Returns true if the timer is paused.
void Reset ()
 Resets the timer.
Number getElapsedf ()
 Returns the time elapsed in floating point microseconds.

Detailed Description

A timer that dispatches trigger events.


Constructor & Destructor Documentation

Timer::Timer ( bool  triggerMode,
int  msecs 
)

Creates a new timer.

Parameters:
triggerModeIf true, will dispatch an event at the specified frequency, otherwise it will simply count time. You normally want this to be true.
msecsTimer frequency in milliseconds.

Member Function Documentation

void Timer::Pause ( bool  paused)

Pauses and resumes the timer.

Parameters:
pausedIf true, pauses the timer, otherwise resumes it.