JSFiddle - React, Tailwind, and code Playground
by RomainMazB
HTML
<p id="output"></p>
JavaScript
var i = 0;
var start = null;
var times = [];
var dur = 5000;
function step(timestamp) {
if (start===null) start = timestamp;
times[i++] = timestamp;
if (timestamp-start<=dur) {
requestAnimationFrame(step);
} else {
document.getElementById('output').innerHTML = times.join('<br>');
}
}
requestAnimationFrame(step);