title: How long does a batch file take to execute?
body: <p>How can I write a script to calculate the time the script took to complete?</p>
  
  <p>I thought this would be the case, but obviously not..</p>
  
  <pre><code>@echo off
  set starttime=%time%
  set endtime=%time%
  
  REM do stuff here
  
  set /a runtime=%endtime%-%starttime%
  echo Script took %runtime% to complete
  </code></pre>