JSFiddle - React, Tailwind, and code Playground

by snover

HTML

<div id="reqs"></div>

JavaScript

function slow() {
    $.ajax({
        url: '/echo/html/',
        async: false,
        data: {
            delay: 1
        },
        complete: function () {
            
        }
    });
    
    $('#reqs').text(~~((new Date() - start) / 100) + ' expected, ' + iters + ' actual');
    
    if (iters++ > 4) {
        $('#reqs').append('<br>Stopping after 5 iterations');
        clearInterval(iv);
    }
};

var iv = setInterval(slow, 100), start = +new Date(), iters = 0;