title: Get time process takes to complete in seconds?
body: <p>My program runs a batch file in cmd.exe, after it finished I want to display a MessageBox to user saying <code>Finished in #.## seconds</code>, </p>
  
  <p>I'm redirecting CMD output to a textbox using <code>process.BeginOutputReadLine()</code>, this is the code I tried:</p>
  
  <pre><code>if (e.Data == null)
  {  
      string time = process.TotalProcessorTime.Seconds.ToString();
      MessageBox.Show("Finished in " + time + " seconds");
  }
  </code></pre>
  
  <p>It took about 7-15 seconds to complete the process, but the MessageBox displayed <code>Finished in 0 seconds</code>.</p>
  
  <p>How do I get the accurate time it took to complete in seconds?</p>