feat: Add work_time_ms to benchmark logging for load analysis
Track actual work time separately from frame time to determine system load percentage: - work_time_ms: Time spent doing actual work before display() - sleep_time = frame_time_ms - work_time_ms This allows calculating load percentage: load% = (work_time / frame_time) * 100 Example at 60fps with light load: - frame_time: 16.67ms, work_time: 2ms - load: 12%, sleep: 14.67ms 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a7fef2aeb6
commit
8583db7225
5 changed files with 16 additions and 3 deletions
|
|
@ -291,6 +291,9 @@ void GameEngine::run()
|
|||
ImGui::SFML::Render(*window);
|
||||
}
|
||||
|
||||
// Record work time before display (which may block for vsync/framerate limit)
|
||||
metrics.workTime = clock.getElapsedTime().asSeconds() * 1000.0f;
|
||||
|
||||
// Display the frame
|
||||
if (headless) {
|
||||
headless_renderer->display();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue