Now using requestAnimationFrame
instead of setTimeout