fps
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
<div id="fps-counter"></div>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
@@ -44,3 +45,40 @@
|
||||
<p>If you believe this is an error, please <a href="/Contact.html">contact us</a>.</p>
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
@@ -66,3 +66,41 @@
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
@@ -126,3 +126,41 @@
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
+38
@@ -32,3 +32,41 @@
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<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>
|
||||
@@ -127,3 +127,41 @@
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
+38
@@ -23,3 +23,41 @@
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
@@ -66,3 +66,41 @@ Drop a star on the repo if you enjoy.
|
||||
<noscript><p><img alt="Clicky" width="1" height="1" src="//in.getclicky.com/101393847ns.gif" /></p></noscript>
|
||||
</body>
|
||||
<!-- Slope game by y8 games, not me.-->
|
||||
<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>
|
||||
@@ -24,3 +24,41 @@
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<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>
|
||||
@@ -147,3 +147,41 @@ window.JOT_formatRelativeToNow=function(a,b){a=((new Date).getTime()-a)/6E4;if(1
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
@@ -49,3 +49,41 @@
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<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>
|
||||
@@ -19,3 +19,41 @@
|
||||
</center>
|
||||
|
||||
</body>
|
||||
<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>
|
||||
@@ -19,3 +19,41 @@
|
||||
<embed id="game" src="../Henry Stickmin - Infiltrating the Airship.swf"></embed>
|
||||
</center>
|
||||
</body>
|
||||
<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>
|
||||
@@ -13,3 +13,41 @@
|
||||
|
||||
|
||||
</html>
|
||||
<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>
|
||||
@@ -16,3 +16,41 @@
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<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>
|
||||
@@ -13,3 +13,41 @@
|
||||
|
||||
|
||||
</html>
|
||||
<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>
|
||||
@@ -16,3 +16,41 @@
|
||||
|
||||
|
||||
</html>
|
||||
<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>
|
||||
@@ -12,3 +12,42 @@
|
||||
<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>
|
||||
|
||||
<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>
|
||||
Reference in New Issue
Block a user