Overview
Uses two Timer instances (real and game). Each frame update() computes unscaled delta from real timer milliseconds.
deltaTime() multiplies by timeScale. time() returns scaled elapsed seconds. realtimeSinceStartup() is unscaled wall time.
waitForNextFrame() spins with 1 ms sleeps until 1000/targetFps ms elapsed—not called from Application::update (commented out).
How it works
init()starts timers.- Each
update(), delta = (now − last) ms × 0.001. ApplicationreadsdeltaTime()only whenENGINE_STATEisPLAYING.
Internal architecture
ModuleTime
├── m_realTimer / m_gameTimer
├── m_lastRealDelta, m_scale, m_frames
└── waitForNextFrame() (optional pacing — unused in main loop)
Relationships
- Consumed by gameplay systems, particles (
ModuleParticleSystem::deltaTime), haptics envelopes, scripts (via engine APIs), and logger timestamps (WindowLogger).
Technical features
- Separate real vs game timers with configurable time scale.
- Target FPS stored at construction (
ModuleTime(120)); pacing API exists but is not wired into the main loop.
Implementation notes
- Verified: delta/time scale API.
- Partial: frame limiting API exists but not integrated into main loop.