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