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.

```
 //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);
 }

```