Timer(Object)

Timer is an object that fires a OnTrigger event that can be subscribed to. The Timer can be started, stopped, paused and be set to loop or not.

Functions

Timer(TimeSpan timeSpan) Creates a timer that will fire a trigger every time the timeSpan passes.
Timer(TimeSpan timeSpan, Boolean loop) Creates a timer that will fire a trigger every time the timeSpan passes. If loop is set to true, the timer will continue. If set to false, the timer will trigger once.

Static Functions

Timer.Delay(TimeSpan timeSpan, Function func) Timer Executes the function after the provided time. Returns the Timer.
Timer.Delay(TimeSpan timeSpan, Delegate del) Timer Executes the delegate after the provided time. Returns the Timer.

Events

OnTrigger EventArgs Fired once the set time elapses.

Fields

Loop Boolean If set to true, the timer will continue to trigger. If false, the timer will trigger once.
Running Boolean Set to true if the timer is currently running.
Paused Boolean Set to true if the timer is currently paused.
SynchronousTrigger Boolean If set to false, the trigger will begin the next loop before the trigger finishes. If set to true, the next loop will begin after the trigger finishes.
Tag Object Any object given to the timer.

 

Functions

Pause(TimeSpan timeSpan) Pauses the timer for the provided timeSpan
Reset() Restarts the timer.
Start() Starts the timer.
Stop() Stops the timer.

Last edited May 30, 2011 at 2:20 PM by dahrkdaiz, version 6

Comments

No comments yet.