Skip to main content

Module time

Module time 

Source
Expand description

The per-frame Time resource — the engine’s single clock.

Time carries the real wall-clock frame delta, the fixed simulation step, and the render-interpolation factor. It is the bridge between the decoupled fixed-timestep simulation and the variable-rate render:

  • The simulation advances in whole fixed_delta_seconds steps via an accumulator in the scheduler, so it is frame-rate independent (deterministic).
  • Rendering happens once per frame; to stay smooth between sim steps the render path blends the previous and current transforms by interpolation_alpha.

The scheduler publishes a fresh Time each frame; game code and Flows read it. It lives in Runtime::resources behind an Arc<RwLock<Time>> so the scheduler (which holds Arc<Runtime>) can write it while Flows and game update (which borrow &Runtime) read it.

Structs§

Time
Per-frame timing state shared between the simulation and the render path.

Constants§

DEFAULT_FIXED_DELTA_SECONDS
Default fixed simulation step — 60 Hz.

Type Aliases§

SharedTime
Shared, interior-mutable handle to the engine’s Time resource.