JSFiddle - React, Tailwind, and code Playground
HTML
<div id="haha"></div>
JavaScript
$(function() {
var ele = $('#haha');
var clr = null;
var rand = (Math.random() * 100000) >> 0;
(loop = function() {
clearTimeout(clr);
(inloop = function() {
ele.html(rand+=1);
if(!(rand % 50)) {
return;
}
clr = setTimeout(inloop, 30);
})();
setTimeout(loop, 2500);
})();
});