aboutsummaryrefslogtreecommitdiffstats
path: root/site
diff options
context:
space:
mode:
authorbrian cully <bjc@spork.org>2025-12-26 16:59:01 -0500
committerbrian cully <bjc@spork.org>2025-12-26 16:59:01 -0500
commit9b2b88e70e49b4e79ab1bc72eaee2c3a11ebfb28 (patch)
tree855f31a69f2c66aea991fc4c6b7b6fbc7cdf6701 /site
parenta2dfebbcdc54870bb4a56545bde828f3fbbe48d9 (diff)
downloadpolyring-9b2b88e70e49b4e79ab1bc72eaee2c3a11ebfb28.tar.gz
polyring-9b2b88e70e49b4e79ab1bc72eaee2c3a11ebfb28.zip
try to calculate fps in spite of fingerprinting
Diffstat (limited to 'site')
-rw-r--r--site/main.css6
-rw-r--r--site/main.mjs6
2 files changed, 11 insertions, 1 deletions
diff --git a/site/main.css b/site/main.css
index f875232..19a3835 100644
--- a/site/main.css
+++ b/site/main.css
@@ -9,3 +9,9 @@ canvas {
border: 1px solid orangered;
background-color: rgb(200 200 200);
}
+
+#fps {
+ display: inline-block;
+ width: 2em;
+ text-align: right;
+}
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);