title: Count-Up Timer on each page load from 0
body: <p>I want to implement a count-up timer JS code that starts counting at each load page from 0. The code which I've now is like this:</p>
  
  <pre><code>var secondsTotal = 0;
  
  setInterval(function() {
      ++secondsTotal;
      var minutes = Math.floor(secondsTotal / 60);
      var seconds = Math.floor(secondsTotal)  % 60;
      var milliseconds = Math.floor(secondsTotal) % 1000;
  
      document.getElementById('counter').innerHTML = minutes + ":" + seconds + "." + milliseconds;
  }, 1000);
  </code></pre>
  
  <p>The output format should be: <code>00:00.0</code></p>
  
  <p><strong>mm:ss.ms</strong></p>
  
  <p>So, how to output the result like above format (minutes and seconds should be exactly printed in two digits format)?</p>