JSFiddle - React, Tailwind, and code Playground

JavaScript

var foo = window.performance.now();

function action() {
    foo = window.performance.now();    
    setTimeout(action, Math.random() * 10);    
}

setTimeout(action, Math.random() * 10);

function tick(timestamp) {
    var dt = timestamp - foo;
    if (dt < 0) {
        console.log("Anomaly, dt is " + dt);   
    }
    window.requestAnimationFrame(tick);
}

window.requestAnimationFrame(tick);