This commit is contained in:
mileswa1q22 authored and GitHub committed 2023-12-20 15:16:52 +00:00
1 parent c6d9d86d1f
commit 9246b0ea6f
3 files changed
+17 -16

No files matched your search

+15 -14
View File
@@ -17,17 +17,18 @@ alert("fun yesss🎅🏼 you found santa congrats you won")
alert("your mom still in testing")
}
var fps = document.getElementById("fps");
var startTime = Date.now();
var frame = 0;
function tick() {
var time = Date.now();
frame++;
if (time - startTime > 1000) {
fps.innerHTML = (frame / ((time - startTime) / 1000)).toFixed(1);
startTime = time;
frame = 0;
}
window.requestAnimationFrame(tick);
}
tick();
var startTime = Date.now();
var frame = 0;
function tick() {
var time = Date.now();
frame++;
if (time - startTime > 1000) {
fps.innerHTML = (frame / ((time - startTime) / 1000)).toFixed(1);
startTime = time;
frame = 0;
}
window.requestAnimationFrame(tick);
}
tick();