title: What is Best way to calculate time span
body: <p>In my c# program, my requirement is to calculate a timespan for business logic execution that is inside a foreach loop I have to store time span.</p>
  
  <p>I am using following code</p>
  
  <pre><code>for (int i = 0; i &lt; 100; i++)
  {
      DateTime start= DateTime.Now; 
      // Business logic
      DateTime end= DateTime.Now; 
      TimeSpan time = start.Subtract(end);
      // Save timespan in log file
  }
  </code></pre>
  
  <p>Please correct me whether I am using right code, or do I need to modify for better performance and result.</p>