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,
requestAnimationFrameis already optimized and it is intented to be used for rendering on canvas. In fact,requestAnimationFrameruns about 16ms, but you madesetTimeoutrun even faster with 1ms. UsingsetTimeoutmakes it even worse. Read the documentation before uploading your useless piece of code here.