Skip to content

FixedIntervalTickSource

Defined in: src/modules/tick/fixed-interval-tick-source.ts:19

Time-driven tick source that fires at a fixed interval via setInterval. Suitable for:

  • Real-time prototypes (arcade games, sandboxes) that want a simple “simulate at N Hz” timer without building a fixed-step accumulator.
  • Any consumer where drift under tab-throttling is acceptable.

Emits TickInfo { kind: 'fixed', deltaMs: intervalMs, tickNumber }. deltaMs is the nominal interval, not the measured wall time — callers that need wall-time accuracy should use an rAF-driven source instead.

start() and stop() are idempotent; calling either repeatedly is a no-op in the already-started/stopped state. Unsubscribed handlers stop receiving ticks, but the interval timer remains active until stop() is explicitly called — callers are responsible for stopping the source.

new FixedIntervalTickSource(intervalMs): FixedIntervalTickSource

Defined in: src/modules/tick/fixed-interval-tick-source.ts:25

number

FixedIntervalTickSource

get tickNumber(): number

Defined in: src/modules/tick/fixed-interval-tick-source.ts:59

number

start(): void

Defined in: src/modules/tick/fixed-interval-tick-source.ts:41

void

TickSource.start


stop(): void

Defined in: src/modules/tick/fixed-interval-tick-source.ts:47

void

TickSource.stop


subscribe(handler): () => void

Defined in: src/modules/tick/fixed-interval-tick-source.ts:54

(info) => void

() => void

TickSource.subscribe