# Migrating to 3.0: What to use instead of glfwSleep?

**URL:** <https://discourse.glfw.org/t/migrating-to-3-0-what-to-use-instead-of-glfwsleep/577>\
**Category:** support\
**Created:** [June 13, 2013, 4:03am UTC](https://discourse.glfw.org/t/migrating-to-3-0-what-to-use-instead-of-glfwsleep/577 "2013-06-13T04:03:20Z")\
**Posts on this page:** 1\
**Showing post:** 29

<div class="post-metadata">

**Author:** ![8Observer8](https://avatars.discourse-cdn.com/v4/letter/8/bbe5ce/32.png) [@8Observer8](https://discourse.glfw.org/u/8Observer8)\
**Post date:** [November 3, 2022, 8:09am UTC](https://discourse.glfw.org/t/migrating-to-3-0-what-to-use-instead-of-glfwsleep/577/29 "2022-11-03T08:09:32Z")

</div>

I need 3-5 and sometimes 30 FPS for non-gaming applications with interactive 3D graphics. They should run on inexpensive laptops without noise. I want to try GLFW3 instead of SDL2. Can anyone write a cross platform equivalent of this code using GLFW3:

```auto
const float maxFPS = 3.f;

int main()
{
    /* ... */
    bool running = true;
    while (running)
    {
        float startTicks = SDL_GetTicks();
        // Drawing ...
        // Limit the FPS to the max FPS
        float frameTicks = SDL_GetTicks() - startTicks;
        if (1000.f / maxFPS > frameTicks)
        {
            SDL_Delay(1000.f / maxFPS - frameTicks);
        }
    }
    /* ... */
}

```

---

_[View the full topic](https://discourse.glfw.org/t/migrating-to-3-0-what-to-use-instead-of-glfwsleep/577)._
