Static methods
Constructor
new(callback:() ‑> Void, delay:Float)
Creates a timer
Parameters:
callback | A function to call after the timer was triggered |
---|---|
delay | Amount of seconds to wait |
Variables
Methods
loop(lock:Bool = true):Bool
Loops the timer.
Parameters:
lock | Whether to skip if the timer is already started |
---|
Returns:
Returns true if the timer was looped
repeat(count:Int = 1, lock:Bool = true):Bool
Starts the timer repeatedly.
Parameters:
count | How many times to start the timer. 0 for infinity |
---|---|
lock | Whether to skip if the timer is already started |
Returns:
Returns true if the timer was repeated
start(lock:Bool = true):Bool
Starts the timer
Parameters:
lock | Whether to skip if the timer is already started |
---|
Returns:
Returns true if the timer was started