JSFiddle - React, Tailwind, and code Playground

HTML

<body>
    <div id="msg">Not Started</div>
    <button>jQuery</button>
</body>

JavaScript

(function(){
    
    function addSecs(d, s) {return new Date(d.valueOf()+s*1000);}

    var start, end;

        
    $(function() {
            $('button').click(function(){
                (function(cont){
                    $('div').text('Processing JQ...00' + start);  
                    start = new Date();
                    end = addSecs(start,5);
                    setTimeout(cont, 1);
                })(function(){
                    do {start = new Date();} while (end-start > 0);
                    $('div').text('Finished JQ 00');   
                })
            });
    });

})();