-
Notifications
You must be signed in to change notification settings - Fork 2
Timing and Ticks
Gondwana uses a high-resolution tick-based timing model.
Real elapsed time is measured with HighResTimer, while recurring or one-shot scheduled behavior is exposed through Timer.
Every engine cycle computes elapsed time and uses that to drive:
- timer events
- animation advancement
- sprite movement
- camera updates
- CPS/FPS sampling
Timers can be:
- pre-cycle
- post-cycle
- once
- repeating
This lets gameplay code schedule work at predictable points in the cycle. Users can instantiate their own Timers, and the corresponding event(s) will be raised by the Engine.
Ticks are the engine’s low-level clock. Seconds are usually derived from them, but the underlying representation stays high-resolution and stable.
The engine also samples gross CPS (cycles per second, background tasks) and rendered FPS (frames per second, foreground tasks). Those numbers are useful when diagnosing whether you are CPU-bound, render-bound, or simply not invalidating enough to repaint frequently.
Gondwana/Timers/HighResTimer.csGondwana/Timers/Timer.csGondwana/Engine.cs