title: DateTime Difference in time and milliseconds
body: <p>I need the difference of two datetime down to the millisecond comparison the first datetime is going to be less than the second, its to stop a loop in the gridviews delete event</p>
  
  <pre><code>protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
  {
      if (!Ok2Delete(e.RowIndex)) return;    
  
      // your logic goes here and the above IF statement 
      // will hopefully guarantee your code to run once.
  }
  private bool Ok2Delete(int ri) // ri is the record index to be deleted
  {
      if (Session["ri"] == null ||
          (!((ri == ((int)Session["ri"])) &amp;&amp;
          (DateTime.Now.Subtract((DateTime)Session["ri_time_stamp"]).Seconds &lt; 2))))
      {
          Session["ri"] = ri;
          Session["ri_time_stamp"] = DateTime.Now;
          return true;
      }
      return false;
  }
  </code></pre>
  
  <p>this code isn't working as expected</p>