Methods
-
interval(interval, callback, context [, tag])
-
Create a repeat timer.
Parameters:
Name Type Argument Description interval
number Time in milliseconds
callback
function Callback function to run, when timer ends
context
object Context of the callback to be invoked
tag
string <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 interval
number Time in seconds
callback
function Callback function to run, when timer ends
context
object Context of the callback to be invoked
tag
string <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 wait
number Time in milliseconds
callback
function Callback function to run, when timer ends
context
object Context of the callback to be invoked
tag
string <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 wait
number Time in seconds
callback
function Callback function to run, when timer ends
context
object Context of the callback to be invoked
tag
string <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 tag
string Tag of timers to resume
Returns:
Self for chaining
- Type
- SystemTimer
-
remove(timer)
-
Remove a timer.
Parameters:
Name Type Description timer
Timer Timer to remove
-
resumeTimersTagged(tag)
-
Resume timers with a specific tag.
Parameters:
Name Type Description tag
string Tag of timers to resume
Returns:
Self for chaining
- Type
- SystemTimer