title: Time elapse computation in milliseconds C#
body: <p>I need to time the execution of a code sequence written in C#. Using DateTime.Now I get incorrect values for the millisecond field. 
     For example:</p>
  
  <pre><code> int start_time, elapsed_time;
  
   start_time = DateTime.Now.Millisecond;
  
   for(int i = 0; i &lt; N_ITER; i++) {
         // cpu intensive sequence
   }
  
   elapsed_time = DateTime.Now.Millisecond - start_time;
  </code></pre>
  
  <p>elapsed_time gives negative values. </p>
  
  <p>How may I replace DateTime in order to obtain the actual value of the elapsed time?</p>