DEV Community

Discussion on: Why not to use setInterval

Collapse
 
juanmendes profile image
juanmendes • Edited

Another reason is because setIntervals stop running if your browser window loses focus, your callbacks will queue up and run once the page has focus again. Or even worse, they will be dropped. See jsfiddle.net/mendesjuan/y3h1n6mk/