BRL.Timer: Functions Source  


Functions

CreateTimerCreate a timer
TimerTicksGet timer tick counter
WaitTimerWait until a timer ticks
StopTimerStop a timer

Function reference

Function CreateTimer:TTimer( hertz#,event:TEvent=Null )
ReturnsA new timer object
DescriptionCreate a timer
Information CreateTimer creates a timer object that 'ticks' hertz times per second.

Each time the timer ticks, event will be emitted using EmitEvent.

If event is Null, an event with an id equal to EVENT_TIMERTICK and source equal to the timer object will be emitted instead.

Function TimerTicks( timer:TTimer )
ReturnsThe number of times timer has ticked over
DescriptionGet timer tick counter

Function WaitTimer( timer:TTimer )
ReturnsThe number of ticks since the last call to WaitTimer
DescriptionWait until a timer ticks
Example
timer=CreateTimer( 10 )

Repeat
	Print "Ticks="+WaitTimer( timer )
Forever

Function StopTimer( timer:TTimer )
DescriptionStop a timer
InformationOnce stopped, a timer can no longer be used.