For animations/any sort of render loop, you can also make use of the requestAnimationFrame API, which auto-pauses when the tab is out of focus.
https://developer.mozilla.org/en-US/docs/Web/API/window/requ...
https://developer.mozilla.org/en-US/docs/Web/API/window/requ...
No comments yet.