title: Accurate way to measure request/response times of an Asp.Net MVC application
body: <p>Consider the following code for measuring request/response times in an Asp.Net application:</p>
  
  <pre><code>protected void Application_EndRequest()
  {
      Trace.WriteLine(string.Format("{0}:{1}",
           (DateTime.Now - HttpContext.Current.Timestamp).TotalMilliseconds,
           HttpContext.Current.Request.RawUrl));
  }
  </code></pre>
  
  <p>According to <a href="http://msdn.microsoft.com/en-us/library/system.datetime.now.aspx" rel="nofollow">MSDN</a>, <code>DateTime.Now</code> has an approximate resolution of 10 milliseconds.</p>
  
  <p>Also, from <a href="http://msdn.microsoft.com/en-us/library/system.web.httpcontext.timestamp.aspx" rel="nofollow">MSDN HttpContext.Timestamp description</a>,</p>
  
  <blockquote>
    <p>The timestamp returned from the <code>Timestamp</code> property is the local time of the server and is set during the instantiation of the <code>HttpContext</code> object. The local time is equal to the UTC time plus the UTC offset.</p>
  </blockquote>
  
  <p>The above code should in theory then give me the total request/response time in milliseconds.  </p>
  
  <p>My question is, how accurate is this going to be?  And is there a more accurate / better way of going about it?</p>