Skip to content

Instantly share code, notes, and snippets.

@sergiogarciadev
Created July 23, 2015 17:16
Show Gist options
  • Save sergiogarciadev/bd450e2c443b49434d45 to your computer and use it in GitHub Desktop.
Save sergiogarciadev/bd450e2c443b49434d45 to your computer and use it in GitHub Desktop.
(function () {
var d = time(), frames = 0;
function time() {
return parseInt(new Date() / 1000);
}
function fpsCounter() {
if (d != time()) {
console.log(frames + ' fps');
frames = 0;
d = time();
}
frames++;
window.requestAnimationFrame(fpsCounter)
}
fpsCounter();
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment