diff --git a/src/main.js b/src/main.js index bbc9d0f..891b7c2 100644 --- a/src/main.js +++ b/src/main.js @@ -52,9 +52,10 @@ export class App { run = () => { // Calculating FPS - let newTime = Date.now(); - Settings.delta = (newTime - Settings.prevTime) / 1000; - Settings.prevTime = newTime; + let fpsNewTime = Date.now(); + Settings.fpsDelta = (fpsNewTime - Settings.fpsPrevTime) / 1000; + Settings.fpsPrevTime = fpsNewTime; + Settings.fps = Math.round(1 / Settings.fpsDelta); // clear canvas this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);