# new RezTimer()
Represents a timer in the Rez game engine. Timers can be configured to run once or repeatedly, with optional count-down functionality. When triggered, they dispatch timer events through the game's event processor.
Extends
Methods
# static constructor(id, attributes)
Creates a new timer instance with the specified configuration
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string
|
unique identifier for this timer |
attributes |
object
|
timer attributes from Rez compilation |
# static dec_counter()
Decrements the timer's count attribute if present. When count reaches zero, the timer automatically stops itself.
# static notify()
Called when the timer fires. Decrements the count (if present) and dispatches a timer event through the game's event processor.
# static running() → {boolean}
Indicates whether the timer is currently running and will trigger events
true if the timer is currently active
boolean
# static start()
Starts the timer using either setInterval (for repeating timers) or setTimeout (for one-shot timers). The timer will trigger the notify method when it fires.
# static stop()
Stops the timer by clearing the timeout/interval and resetting the internal timer reference