use requestAnimationFrame instead setTimout