xxxxxxxxxx
let info, rate=120;
function setup() {
createCanvas(windowWidth, windowHeight);
// HUD display init
info = createElement("p","ok");
info.style("user-select","none");
info.style("color","#0cf");
info.style("font-size","24px");
info.position(20,0);
frameRate(120);
}
function draw() {
background(100);
// HUD count and framerate
if(frameCount%30==0)rate=(rate*5+frameRate())/6;
info.html("fps: "+floor(rate), false);
circle(mouseX, mouseY, 30);
}