JSFiddle - React, Tailwind, and code Playground
HTML
<html>
<body>
You've wasted time <span id="alltime">0.00</span> seconds.
<script type="text/javascript">
function zeroPad(num,count)
{
var numZeropad = num + '';
while(numZeropad.length < count) { numZeropad = "0" + numZeropad; }
return numZeropad; }
function counttwo()
{
tall = document.getElementById('alltime').innerHTML;
if(parseFloat(tall) < 1.00) {
tnew2 = tall.replace('0.0','').replace('0.','');
}
else {
tnew2 = tall.replace('.','');
}
tnum = parseInt(tnew2) + 1;
if(tnum >= 100) { tstr1 = tnum + ''; }
else { tstr1 = zeroPad(tnum,3); }
dotw = tstr1.indexOf('.');
tlast = tstr1.substr(0,tstr1.length - 2) + '.' + tstr1.substr(tstr1.length - 2);
document.getElementById("alltime").innerHTML = tlast;
}
var inttwo=setInterval("counttwo()",10);
</script>
</body>
</html>