From 485812632a6f377b9eaa537264e85084e56ff2a5 Mon Sep 17 00:00:00 2001 From: illusion0001 <37698908+illusion0001@users.noreply.github.com> Date: Fri, 26 Nov 2021 20:12:43 -0600 Subject: [PATCH] Add FPS to microprofiler --- third_party/microprofile/microprofileui.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/third_party/microprofile/microprofileui.h b/third_party/microprofile/microprofileui.h index d422445dd..fd140d755 100644 --- a/third_party/microprofile/microprofileui.h +++ b/third_party/microprofile/microprofileui.h @@ -2948,7 +2948,8 @@ void MicroProfileDrawMenu(uint32_t nWidth, uint32_t nHeight) float fMs = fToMs * (S.nFlipTicks); float fAverageMs = fToMs * (S.nFlipAggregateDisplay / nAggregateFrames); float fMaxMs = fToMs * S.nFlipMaxDisplay; - int nLen = snprintf(FrameTimeMessage, sizeof(FrameTimeMessage)-1, "Time[%6.2f] Avg[%6.2f] Max[%6.2f]", fMs, fAverageMs, fMaxMs); + float fps = 1000 / fMs; // maybe fAverageMs is better cuz it's averages? + int nLen = snprintf(FrameTimeMessage, sizeof(FrameTimeMessage)-1, "FPS [%6.2f] Time [%6.2f] Avg [%6.2f] Max [%6.2f]", fps, fMs, fAverageMs, fMaxMs); pMenuText[nNumMenuItems++] = &FrameTimeMessage[0]; MicroProfileDrawText(nWidth - nLen * (MICROPROFILE_TEXT_WIDTH+1), 0, -1, FrameTimeMessage, nLen); }