diff --git a/src/SFML/Window/Window.cpp b/src/SFML/Window/Window.cpp index 4b00bc106..5a39d2c44 100644 --- a/src/SFML/Window/Window.cpp +++ b/src/SFML/Window/Window.cpp @@ -187,8 +187,7 @@ void Window::display() // Limit the framerate if needed if (m_frameTimeLimit != Time::Zero) { - sleep(m_frameTimeLimit - m_clock.getElapsedTime()); - m_clock.restart(); + sleep(m_frameTimeLimit - m_clock.restart()); } } diff --git a/src/SFML/Window/iOS/EaglContext.mm b/src/SFML/Window/iOS/EaglContext.mm index 868af9f89..0837ae992 100644 --- a/src/SFML/Window/iOS/EaglContext.mm +++ b/src/SFML/Window/iOS/EaglContext.mm @@ -258,8 +258,7 @@ void EaglContext::display() if (m_vsyncEnabled) { constexpr Time frameDuration = seconds(1.f / 60.f); - sleep(frameDuration - m_clock.getElapsedTime()); - m_clock.restart(); + sleep(frameDuration - m_clock.restart()); } }