Skip to main content

Module frames

Module frames 

Source
Expand description

FrameClock/FrameStats accumulators for the App/Frame game loop. FrameClock and FrameStats, the two accumulators behind the App/Frame game loop.

Both are pure accumulators fed by Frame::delta: neither reads a clock itself, they only consume wall time the driver hands them, which keeps both no_std-clean and platform-agnostic (including wasm, where there is no std::time::Instant). Split across clock.rs/stats.rs (this file just re-exports), one file per concept: FrameClock decouples fixed-rate logic updates from rendering, FrameStats is a rolling window of frame durations for a live perf/FPS overlay.

Structsยง

FrameClock
A fixed-timestep accumulator.
FrameStats
A fixed-size ring buffer of recent per-frame durations, plus the min/max/average/fps readouts derived from it.