void OnEndRequest(object sender, System.EventArgs e)
{
if (HttpContext.Current.IsDebuggingEnabled)
{
Stopwatch stopwatch =
(Stopwatch)HttpContext.Current.Items["Stopwatch"];
if (stopwatch != null)
{
stopwatch.Stop();
TimeSpan ts = stopwatch.Elapsed;
string elapsedTime = String.Format("{0}ms", ts.TotalMilliseconds);
WriteResult(elapsedTime);
}
}
}