JSFiddle - React, Tailwind, and code Playground
HTML
<span id="downtime">0</span>
<input type="button" id="recycle" value="recycle"/>
JavaScript
$().ready(function () {
var initialDate = new Date();
setInterval(function() {
var currentDate = new Date();
$("#downtime").html("downtime: " + (currentDate - initialDate) + " milliseconds");
}, 1000);
$("#recycle").on("click", function () {
initialDate = new Date();
});
});