aboutsummaryrefslogtreecommitdiffstats
path: root/site/main.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'site/main.mjs')
-rw-r--r--site/main.mjs6
1 files changed, 5 insertions, 1 deletions
diff --git a/site/main.mjs b/site/main.mjs
index 280ee43..f3571ec 100644
--- a/site/main.mjs
+++ b/site/main.mjs
@@ -222,10 +222,14 @@ async function loaded() {
};
let lastTime = document.timeline.currentTime;
+ let interCount = 0;
function render(t) {
if (t > lastTime) {
- fps.textContent = Math.floor(1_000 / (t - lastTime));
+ fps.textContent = Math.floor(1_000 * interCount / (t - lastTime));
lastTime = t;
+ interCount = 0;
+ } else {
+ interCount++;
}
ctx.clearRect(0, 0, canvas.width, canvas.height);