xxxxxxxxxx
39
var frt = 0;
var limitreach;
var seconds = 0;
var counter;
var cnt;
var seconds2 = 0;
var minutes;
var seconds3 = 0;
function setup() {
createCanvas(400, 400);
frameRate(60);
alert(
"The longer you let it run the more accurate the calculated result will be (❁´◡`❁)"
);
}
function draw() {
seconds = floor(frameCount / 60);
seconds2 = frameCount / 60;
seconds3 = floor(frameCount / 60) - minutes * 60;
minutes = floor(seconds / 60);
cnt = round(frt / seconds2, 4);
background("white");
const limitreach = `The frame rate has gone above 60 fps ${frt} times and it has
been ${minutes} minutes and ${seconds3} seconds`;
const counter = `
That means the frame rate goes above 60 fps an average of
${cnt} times per second`;
if (floor(frameRate()) > 60) {
frt++;
}
text(limitreach, 0, 14);
text(counter, 0, 56);
textSize(14);
}