Skip to content

TimedTickSource

Defined in: src/modules/stats/timed-tick-source.ts:22

Wraps a TickSource so each downstream tick’s wall-clock cost is measured and fed into a FrameStats. Use it to time work whose tick source reports a nominal delta rather than measured time — e.g. a fixed logic tick (FixedIntervalTickSource emits the configured interval, not how long the tick actually took). Pairing this around the logic source with a plain sample(deltaMs) of the rAF render source gives a live logic-ms-vs-render-ms split (is the frame logic-bound or render-bound?).

The wrapper measures the span across all subscribers’ handling of a tick (a single performance.now() bracket per emitted tick), then forwards the original TickInfo unchanged. start/stop/subscribe delegate to the wrapped source.

Note: this times the synchronous portion of subscriber callbacks. For a TickRunner-driven source the subscriber runs the scheduler synchronously, so the measured span is the per-tick system cost.

new TimedTickSource(inner, stats, now?): TimedTickSource

Defined in: src/modules/stats/timed-tick-source.ts:29

TickSource

FrameStats

() => number

TimedTickSource

start(): void

Defined in: src/modules/stats/timed-tick-source.ts:35

void

TickSource.start


stop(): void

Defined in: src/modules/stats/timed-tick-source.ts:46

void

TickSource.stop


subscribe(handler): () => void

Defined in: src/modules/stats/timed-tick-source.ts:52

(info) => void

() => void

TickSource.subscribe