Use requestAnimationFrame and support variable timestep