title: JavaScript: Code to capture System time by clicking on a button
body: <p>I need a javascript code that would help me create a button and when click on the button it would start to capture the system time.</p>
  
  <p>Once the time capture starts two additional buttons should reflect Pause and Stop. When i click on pause button the time capture should stop. Again if i click on the pause (which changes to start) button the time should start to capture again. When i click on stop the time capture should stop totally and the buttons deactivate.</p>
  
  <p>The time capture should be in minutes.</p>
  
  <p>Here is what i have tried.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;    
      &lt;head&gt;
          &lt;script&gt;
              function myFunction() {
                  alert("Hello World!");
              }
          &lt;/script&gt;
      &lt;/head&gt;    
      &lt;body&gt;
          &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
      &lt;/body&gt;
  
  &lt;/html&gt;
  
  &lt;script language="javascript" type="text/javascript"&gt;
      function getTimeStamp() {
          var now = new Date();
          return ((now.getMinutes() &lt; 10) ? (
             "0" + now.getMinutes()) : (now.getMinutes()));
      }
  &lt;/script&gt;
  &lt;p&gt;&lt;input type="button" value="Start Time" onClick="getTimeStamp();"&gt;&lt;/p&gt;
  </code></pre>