Minimizes frame latency by using window.requestAnimationFrame