From 98d6b49987ca0add127d28c7389cb3ef3f202c8e Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Tue, 8 Dec 2020 01:47:28 +1000 Subject: [PATCH] System: Log FPS/frame times every second --- src/core/system.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/system.cpp b/src/core/system.cpp index 1068b5c4f..8920ecb9c 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -1214,6 +1214,7 @@ void UpdateThrottlePeriod() { s_throttle_period = static_cast(1000000000.0 / static_cast(s_throttle_frequency) / static_cast(s_target_speed)); + ResetThrottler(); } void ResetThrottler() @@ -1296,6 +1297,9 @@ void UpdatePerformanceCounters() s_last_global_tick_counter = global_tick_counter; s_fps_timer.Reset(); + Log_PerfPrintf("FPS: %.2f VPS: %.2f Average: %.2fms Worst: %.2fms", s_fps, s_vps, s_average_frame_time, + s_worst_frame_time); + g_host_interface->OnSystemPerformanceCountersUpdated(); }