Core guide

Game timing

Drive deterministic update and draw loops with bounded deltas.

Live example

See Game timing in action

Watch motion advance from frame deltas supplied by the scheduler.

live rendering loading ticks 0

How it works

The scheduler supplies monotonic time to update callbacks. The default frame loop clamps large deltas, while fixed_step opts into bounded fixed updates and reports discarded catch-up time.

Public types

  • FrameScheduler
  • UpdateTime
  • FrameLoopState
  • max_delta_seconds
  • FixedStepOptions

Minimum viable example

typescript
const scheduler: FrameScheduler = {
  request_frame: requestAnimationFrame,
  cancel_frame: cancelAnimationFrame,
  now_seconds: () => performance.now() / 1000,
};

Scope and limitations

Interpolation, rollback, and scheduler integrations beyond the browser frame API are deferred.