PeriodicalTimer
Defined in: packages/core/src/time/periodical-timer.ts:20
A timer that calls a callback function at regular intervals.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new PeriodicalTimer(
callback,intervalMs,options?):PeriodicalTimer
Defined in: packages/core/src/time/periodical-timer.ts:32
Constructs a new PeriodicalTimer.
Parameters
Section titled “Parameters”callback
Section titled “callback”The callback function to call at each interval.
intervalMs
Section titled “intervalMs”number
The interval in milliseconds between each tick.
options?
Section titled “options?”Optional settings for the timer.
Returns
Section titled “Returns”PeriodicalTimer
Properties
Section titled “Properties”intervalMs
Section titled “intervalMs”
readonlyintervalMs:number
Defined in: packages/core/src/time/periodical-timer.ts:34
The interval in milliseconds between each tick.
Methods
Section titled “Methods”isStarted()
Section titled “isStarted()”isStarted():
boolean
Defined in: packages/core/src/time/periodical-timer.ts:70
Returns whether the timer is currently started.
Returns
Section titled “Returns”boolean
True if the timer is started, false otherwise.
start()
Section titled “start()”start():
void
Defined in: packages/core/src/time/periodical-timer.ts:45
Starts the periodical timer. If the timer is already started, this does nothing.
Returns
Section titled “Returns”void
stop()
Section titled “stop()”stop():
void
Defined in: packages/core/src/time/periodical-timer.ts:60
Stops the periodical timer. If the timer is not started, this does nothing.
Returns
Section titled “Returns”void