Class Chrono
A Chrono class (extends Singleton)
Usage:
c = Chrono.getInstance!
Functions
chrono.new () | constructor. |
Methods
chrono\getTimersCount () | will return the number of active timers. |
chrono\create (owner, duration, repeated, alwaysUpdate, onDone) | creates a timer. |
chrono\update (dt) | updates the active timers. |
Functions
Methods
- chrono\getTimersCount ()
-
will return the number of active timers.
Returns:
-
number
- chrono\create (owner, duration, repeated, alwaysUpdate, onDone)
-
creates a timer. This timer will be removed automatically from owner if
"chrono" is the key for the timer instance.
You can set it to be repeated with the same duration and onDone callback.
Parameters:
- owner Control
- duration number
- repeated boolean
- alwaysUpdate bool
- onDone function
Returns:
- chrono\update (dt)
-
updates the active timers.
Parameters:
- dt number