In some cases, requestAnimationFrame() can/should be used in place of setInterval(). Mostly, as the name suggests, for animation, which I would extend to mean any time your “interval” is updating the DOM. This way you keep in step with the browser repaint, which can streamline rendering and improve performance.
In some cases, requestAnimationFrame() can/should be used in place of setInterval(). Mostly, as the name suggests, for animation, which I would extend to mean any time your “interval” is updating the DOM. This way you keep in step with the browser repaint, which can streamline rendering and improve performance.
Thanks for sharing this Kevin. Appreciate it!