title: How do I calculate a duration time?
body: <p>I am developing a web-based application to capture start time and end time from system date-time but my main problem is that I don't know how can I get the duration time, between start and end time for downtime.</p>
  
  <pre><code> //Function to get current start time
    var startTime = setInterval(function () { start() }, 1000);
  
    function start() {
      var startDate = new Date();
      var timeStart = startDate.toLocaleTimeString();
    $("#setCount").html(timeStart);
   }
  </code></pre>