diff --git a/main.cpp b/main.cpp index 3f91470..0aedcd7 100644 --- a/main.cpp +++ b/main.cpp @@ -115,7 +115,12 @@ int main() ImGui::SetNextWindowBgAlpha(0.2f); ImGui::Begin("FPS", nullptr ,window_flags); if (fpsDataClock.getElapsedTime().asMilliseconds() > 20) { - frameTimings[frameCount%100] = static_cast(deltaT.asMicroseconds()); + if (frameCount >= 100) { + memmove(frameTimings, frameTimings + 1, 99 * sizeof(float)); + frameTimings[99] = static_cast(deltaT.asMicroseconds()); + } else [[unlikely]] { + frameTimings[frameCount] = static_cast(deltaT.asMicroseconds()); + } frameCount++; fpsDataClock.restart(); }