new DelayedTask(func, delay)
Create a new delayed task.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
func | function | Function to run after timer has run out | |
delay | number | 0 | Amount of time to wait before running (delay) |
- Source
Extends
Methods
init()
Initialize the task.
- Overrides
- Source
isDone() → {boolean}
Check if the task is complete and can be removed.
- Overrides
- Source
Returns:
Whether the task has completed
- Type:
- boolean
stop()
Set the task's status to done so it will be removed.
- Overrides
- Source
update(elapsed)
Update the task.
Parameters:
Name | Type | Description |
---|---|---|
elapsed | number | Time since last update cycle in seconds |
- Overrides
- Source