This commit is contained in:
Robert
2025-04-01 14:34:22 +00:00
committed by GitHub
parent dbd8538d63
commit 169d163680
17 changed files with 656 additions and 9 deletions
+40 -1
View File
@@ -11,4 +11,43 @@
<a href="/games/henreystikman/Escaping The Prison.html"> henrey Escaping The Prison</a>
<a href="/games/henreystikman/Stealing_the_Diamond.html">Stealing_the_Diamond</a>
<a href="/games/flasharchive-main/flasharchive-main/html/hs-ita-1.html">Henry Stickmin - Infiltrating the Airship</a>
<a href="/games/flasharchive-main/flasharchive-main/html/hs-ftc.html">Henry Stickmin - Fleeing the Complex</a>
<a href="/games/flasharchive-main/flasharchive-main/html/hs-ftc.html">Henry Stickmin - Fleeing the Complex</a>
<div id="fps-counter"></div>
<style>
#fps-counter {
position: fixed;
top: 10px;
right: 10px;
font-size: 12px;
color: white;
background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
padding: 5px;
border-radius: 5px;
z-index: 1000; /* Ensure it stays on top */
}
</style>
<script>
const fpsCounter = document.getElementById("fps-counter"); // Moved this to the correct place
function calculateFPS() {
let lastFrameTime = performance.now();
let frames = 0;
function frameLoop() {
const now = performance.now();
frames++;
if (now - lastFrameTime >= 1000) {
const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
fpsCounter.textContent = `FPS: ${fps}`;
frames = 0;
lastFrameTime = now;
}
requestAnimationFrame(frameLoop);
}
frameLoop();
}
calculateFPS(); // Ensure the FPS calculation starts
</script>