DEV Community

Discussion on: JavaScript recurring timers with setInterval

Collapse
 
lexlohr profile image
Alex Lohr

One interesting property of setInterval is that there's no guarantee your code will run. For example, the minimal actual resolution in most browsers will be around 17ms, roughly the time an animation frame needs. While you can request smaller values, don't expect your callback to run more often. Also, when a page's tab is in the background, intervals might get suspended and resumed once the page is back in focus.

Collapse
 
dailydevtips1 profile image
Chris Bongers

Oh that's interesting, wan't aware of that actually 👀