Methods
-
interval(interval, callback, context [, tag])
-
Create a repeat timer.
Parameters:
Name Type Argument Description intervalnumber Time in milliseconds
callbackfunction Callback function to run, when timer ends
contextobject Context of the callback to be invoked
tagstring <optional>
Tag of this timer, default is '0'
Returns:
Timer instance
- Type
- Timer
-
intervalSec(interval, callback, context [, tag])
-
Create a repeat timer while the time is in seconds instead.
Parameters:
Name Type Argument Description intervalnumber Time in seconds
callbackfunction Callback function to run, when timer ends
contextobject Context of the callback to be invoked
tagstring <optional>
Tag of this timer, default is '0'
Returns:
Timer instance
- Type
- Timer
-
later(wait, callback, context [, tag])
-
Create an one-shoot timer.
Parameters:
Name Type Argument Description waitnumber Time in milliseconds
callbackfunction Callback function to run, when timer ends
contextobject Context of the callback to be invoked
tagstring <optional>
Tag of this timer, default is '0'
Returns:
Timer instance
- Type
- Timer
-
laterSec(wait, callback, context [, tag])
-
Create an one-shoot timer while the time is in seconds instead.
Parameters:
Name Type Argument Description waitnumber Time in seconds
callbackfunction Callback function to run, when timer ends
contextobject Context of the callback to be invoked
tagstring <optional>
Tag of this timer, default is '0'
Returns:
Timer instance
- Type
- Timer
-
pauseTimersTagged(tag)
-
Pause timers with a specific tag.
Parameters:
Name Type Description tagstring Tag of timers to resume
Returns:
Self for chaining
- Type
- SystemTimer
-
remove(timer)
-
Remove a timer.
Parameters:
Name Type Description timerTimer Timer to remove
-
resumeTimersTagged(tag)
-
Resume timers with a specific tag.
Parameters:
Name Type Description tagstring Tag of timers to resume
Returns:
Self for chaining
- Type
- SystemTimer