API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classTimer
@codexo/exojs / core / stable
Clock variant with a fixed limit. Inherits start/stop/reset/restart semantics; adds Timer.expired (true once the elapsed time reaches the limit) and remaining-time accessors. Useful for cooldowns, delays, and any timed gating logic where you want to ask "is the duration up?" each frame.
11
props
5
methods
0
events
Import
import { Timer } from '@codexo/exojs'Clock variant with a fixed limit. Inherits start/stop/reset/restart semantics; adds Timer.expired (true once the elapsed time reaches the limit) and remaining-time accessors. Useful for cooldowns, delays, and any timed gating logic where you want to ask "is the duration up?" each frame.
Constructors1
new(limit: SecondsA length of time in seconds. The unit every duration in the public API is expressed in - frame deltas, the fixed step, elapsed totals, timer limits. It is a `n…, autoStart: boolean, timeSource?: TimeSourceA monotonic millisecond clock. Values are only meaningful relative to each other: the origin is the host's, never the wall clock, and the source never jumps ba…): TimerMethods5
destroy(): voidreset(): thisHalt and zero the accumulated time. The clock is left stopped.
restart(): thisReset accumulated time to zero, then immediately start. Common per-frame pattern.
start(): thisBegin accumulating time. No-op when already running.
stop(): thisHalt accumulation. Elapsed time stays at the moment of stopping.
Properties11
elapsedHours: numberClock.elapsedMilliseconds in hours.
Total accumulated time since the last Clock.reset. While the clock is running the value advances on every read, folding in the interval since the previous one; while stopped it stays at the moment of stopping.
elapsedMinutes: numberClock.elapsedMilliseconds in minutes.
Clock.elapsedMilliseconds in seconds.
expired: booleantrue once the elapsed time has reached or exceeded the configured limit.
remainingHours: numberTimer.remainingSeconds in hours.
Timer.remainingSeconds in milliseconds.
remainingMinutes: numberTimer.remainingSeconds in minutes.
Time left until Timer.expired, clamped at zero.
running: booleanSource