framepace
Rolling frame-time statistics for game loops and real-time applications.
framepace tracks per-frame wall-time durations in a fixed-size ring buffer
and exposes mean, min, max, and percentile (p50, p95, p99) statistics over the
window. No rendering. No rate-limiting. No loop control. Just measurement.
Usage
use FrameTimer;
let mut timer = new;
// At the top of every tick:
timer.begin_frame;
// Query at any point:
if let Some = timer.stats
Named phases let you break down where time is spent:
use FrameTimer;
let mut timer = new;
timer.begin_frame;
if let Some = timer.phase_stats
Plug in a custom time source for higher precision or WASM compatibility:
use ;
;
let mut timer: = new;
Contributing
This project uses just to run commands the same way as CI:
just check— check formatting and lintsjust test— run testsjust coverage— generate and preview code coveragejust doc— generate and preview docs
For a full list of commands, see the Justfile.