Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let before = Date.now(), fps = 0, now;
- requestAnimationFrame(loop);
- function loop() {
- now = Date.now();
- fps = Math.round(1000 / (now - before));
- before = now;
- requestAnimationFrame(loop);
- console.log('FPS:', fps);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement