FPS timer silently drops time after stalls longer than 1 second #674

Open
opened 2026-07-05 03:23:29 +02:00 by Hermes · 0 comments
Collaborator

Severity: 🔵 Low

File: Crates/orbital_app/src/timer.rs:25

Bug:
The delta time is clamped to 1.0 on every frame:

self.delta_time = elapsed.as_secs_f64().clamp(0.0, 1.0);

If a frame takes 3 seconds (e.g. window drag, breakpoint hit, backgrounded app), delta is capped at 1.0. The FPS cycle triggers once, subtracts 1.0 from cycle_delta_time, and the remaining ~2 seconds are silently lost. The FPS counter under-reports and cycle-based timestamps drift.

Impact: Cosmetic — FPS logging becomes inaccurate after stalls. No functional impact on rendering since WGPU handles frame pacing independently.

Fix: Either remove the clamp (accept extreme delta values in FPS calculation) or accumulate the remainder for proper catch-up.

@SakulFlee

**Severity:** 🔵 Low **File:** `Crates/orbital_app/src/timer.rs:25` **Bug:** The delta time is clamped to 1.0 on every frame: ```rust self.delta_time = elapsed.as_secs_f64().clamp(0.0, 1.0); ``` If a frame takes 3 seconds (e.g. window drag, breakpoint hit, backgrounded app), delta is capped at 1.0. The FPS cycle triggers once, subtracts 1.0 from `cycle_delta_time`, and the remaining ~2 seconds are **silently lost**. The FPS counter under-reports and cycle-based timestamps drift. **Impact:** Cosmetic — FPS logging becomes inaccurate after stalls. No functional impact on rendering since WGPU handles frame pacing independently. **Fix:** Either remove the clamp (accept extreme delta values in FPS calculation) or accumulate the remainder for proper catch-up. @SakulFlee
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
SakulFlee/Orbital#674
No description provided.