Constructor
new Timer(callback)
A simple cancelable timer.
Parameters:
Name | Type | Description |
---|---|---|
callback |
Function |
- Source:
Members
-
(private) callback_ :Function
-
Type:
- Function
- Source:
-
(private, nullable) id_ :number
-
Type:
- number
- Source:
Methods
-
cancel()
-
Cancel the timer, if it's running.
- Source:
-
schedule(seconds)
-
Schedule the timer, canceling any previous scheduling.
Parameters:
Name Type Description seconds
number - Source:
-
scheduleRepeated(seconds)
-
Schedule the timer, canceling any previous scheduling. Timer will automatically reschedule after the callback fires.
Parameters:
Name Type Description seconds
number - Source: