`requestAnimationFrame` should take care of this already.