Hello everyone, I am trying to recover the current FPS within the game, I tried to use the method below, but even changing the FPS within the arcade: {fps: 10}
configuration, the method always shows another number, it is possible to recover the current FPS correctly?
getFPS() {
let prevTime = Date.now(),
frames = 0;
requestAnimationFrame(function loop() {
const time = Date.now();
frames++;
if (time > prevTime + 1000) {
let fps = Math.round( ( frames * 1000 ) / ( time - prevTime ) );
prevTime = time;
frames = 0;
console.info('FPS: ', fps);
}
requestAnimationFrame(loop);
});
}