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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new TimedTickSource(
inner,stats,now?):TimedTickSource
Defined in: src/modules/stats/timed-tick-source.ts:29
Parameters
Section titled “Parameters”() => number
Returns
Section titled “Returns”TimedTickSource
Methods
Section titled “Methods”start()
Section titled “start()”start():
void
Defined in: src/modules/stats/timed-tick-source.ts:35
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”stop()
Section titled “stop()”stop():
void
Defined in: src/modules/stats/timed-tick-source.ts:46
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”subscribe()
Section titled “subscribe()”subscribe(
handler): () =>void
Defined in: src/modules/stats/timed-tick-source.ts:52
Parameters
Section titled “Parameters”handler
Section titled “handler”(info) => void
Returns
Section titled “Returns”() => void