Calculates frames per second.
Returns a function which needs to be called at the end of each frame.
const fps = fpsCounter();function loop() { fps(); // Calculate fps window.requestAnimationFrame(loop);}loop(); Copy
const fps = fpsCounter();function loop() { fps(); // Calculate fps window.requestAnimationFrame(loop);}loop();
If true (default), prints out the FPS to the console
Calculates after this many frames. Higher numbers smoothes the value somewhat
Calculates frames per second.
Returns a function which needs to be called at the end of each frame.