Creates a new TimerService
instance.
Private
lastPrivate
nextThe next available unique identifier for a timer.
Private
systemInjected system service for time management.
Private
tickablesA record of registered tickable objects, keyed by their unique identifiers.
Private
timersA record of active timers, keyed by their unique identifiers.
Handles periodic updates for timers and tickable objects.
The time delta in milliseconds since the last update.
Clears an interval timer by its unique identifier.
The unique identifier of the timer to clear.
Clears all registered tickable objects.
Clears a timeout timer by its unique identifier.
The unique identifier of the timer to clear.
Clears all active timers.
Registers a tickable object for periodic updates.
The tickable object to register.
Sets a repeating timer that executes a callback function at a specified interval.
The function to execute.
The interval in milliseconds.
The unique identifier for the timer.
Sets a one-time timer that executes a callback function after a specified timeout.
The function to execute.
The timeout in milliseconds.
The unique identifier for the timer.
Sets a timer that executes a callback function after a specified interval.
The function to execute.
The interval in milliseconds.
Whether the timer should repeat (default: false).
The unique identifier for the timer.
Unregisters a tickable object.
The tickable object to unregister.
TimerService
manages timers and tickable objects. It provides methods for setting and clearing timers, as well as managing periodic updates.