replaced requestAnimationFrame with getTime()