Devtools -> Rendering -> FPS meter
const targetFPS = 60;
function animate() {
// do stuff
setTimeout(() => {
animate();
}, 1000 / targetFPS);
}
Is This Recommended?
NO
requestAnimationFrame(animate);
function animate() {
calc();
paint();
requestAnimationFrame(animate);
}
Devtools -> Layers
Doodle Jump