requestAnimationFrame to potentially improve performance.