JSFiddle - React, Tailwind, and code Playground
JavaScript
const c = 100;
let i = 0;
let s = performance.now();
const id = setInterval(start, 0);
function start() {
if (++i > c) {
return clearInterval(id);
}
const now = performance.now();
addText(`setInterval execution delay ${now - s}`);
s = now;
}
function addText(txt) {
const p = document.createElement('p');
p.innerHTML = txt;
document.body.appendChild(p);
}