# GLFW timer pauses when app loses focus

**URL:** <https://discourse.glfw.org/t/glfw-timer-pauses-when-app-loses-focus/152>\
**Category:** support\
**Created:** [May 17, 2004, 1:09am UTC](https://discourse.glfw.org/t/glfw-timer-pauses-when-app-loses-focus/152 "2004-05-17T01:09:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 17, 2004, 1:09am UTC](https://discourse.glfw.org/t/glfw-timer-pauses-when-app-loses-focus/152/1 "2004-05-17T01:09:48Z")

</div>

**[cozman](https://sourceforge.net/u/cozman/)** wrote on [Monday, May 17, 2004](https://sourceforge.net/p/glfw/discussion/247562/thread/8e2a684a/#ce55):

Does the GLFW timer pause when the application loses focus?&nbsp; I recently converted some code from SDL to GLFW, and in SDL I had to compensate for the time the application was paused, while on GLFW my compensation code made the timer jump backwards it seems.&nbsp;&nbsp; Is what I am witnessing the fact that the GLFW timer is stopped when the app loses focus?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 18, 2004, 6:52am UTC](https://discourse.glfw.org/t/glfw-timer-pauses-when-app-loses-focus/152/2 "2004-05-18T06:52:16Z")

</div>

**[marcus256](https://sourceforge.net/u/marcus256/)** wrote on [Tuesday, May 18, 2004](https://sourceforge.net/p/glfw/discussion/247562/thread/8e2a684a/#ce55/f197):

This is new for me. No, the timer should not be affected by focus changes, and afaik the OS does not differ between focused/non-focused application for the timers that I use.

What platform are you experiencing this on?

Could it be that you are seeing the differences in the resolution of the SDL and GLFW timer?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 19, 2004, 12:23am UTC](https://discourse.glfw.org/t/glfw-timer-pauses-when-app-loses-focus/152/3 "2004-05-19T00:23:46Z")

</div>

**[cozman](https://sourceforge.net/u/cozman/)** wrote on [Wednesday, May 19, 2004](https://sourceforge.net/p/glfw/discussion/247562/thread/8e2a684a/#ce55/c668):

Sorry to bother you about this, it was not GLFW at all, I forgot all about an abstraction layer, back in my old code a function named getGlobalTime used to call SDL timer directly, and now it does a little bit of conversion to the GLFW timer format.&nbsp; I was still using it the old way.&nbsp;&nbsp; Sorry for reporting an imaginary bug, I’ll be more careful next time.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [May 19, 2004, 1:53pm UTC](https://discourse.glfw.org/t/glfw-timer-pauses-when-app-loses-focus/152/4 "2004-05-19T13:53:10Z")

</div>

**[marcus256](https://sourceforge.net/u/marcus256/)** wrote on [Wednesday, May 19, 2004](https://sourceforge.net/p/glfw/discussion/247562/thread/8e2a684a/#ce55/c668/af33):

You realize of course that you will now face severe punishment for wasting precious time for GLFW users and developers alike. 😉
