Useless, requestAnimationFrame is already optimized and it is intented to be used for rendering on canvas. In fact, requestAnimationFrame runs about 16ms, but you made setTimeout run even faster with 1ms. Using setTimeout makes it even worse. Read the documentation before uploading your useless piece of code here.
Useless,
requestAnimationFrame
is already optimized and it is intented to be used for rendering on canvas. In fact,requestAnimationFrame
runs about 16ms, but you madesetTimeout
run even faster with 1ms. UsingsetTimeout
makes it even worse. Read the documentation before uploading your useless piece of code here.