title: Page Render Time in ASP.MVC in trace
body: <p>I want to check render time of each page in asp.net mvc application.</p>
  
  <p>i am using asp.net tracing. i have override the OnActionExecuting and OnActionExecuted methods on the BaseController class.</p>
  
  <pre><code>protected override void OnActionExecuting(ActionExecutingContext filterContext)
          {
              string controler = filterContext.RouteData.Values["controller"].ToString();
              string action = filterContext.RouteData.Values["action"].ToString();
              StartTime =System.DateTime.Now;
  
              System.Diagnostics.Trace.Write(string.Format("Start '{0}/{1}' on: {2}", controler, action, System.DateTime.Now.UtilToISOFormat()));
          }
          protected override void OnActionExecuted(ActionExecutedContext filterContext)
          {
              string controler = filterContext.RouteData.Values["controller"].ToString();
              string action = filterContext.RouteData.Values["action"].ToString();
              var totalTime = System.DateTime.Now - this.StartTime;
              System.Diagnostics.Trace.Write(totalTime.ToString());
              System.Diagnostics.Trace.Write(string.Format("End '{0}/{1}' on: {2}", controler, action, System.DateTime.Now.UtilToISOFormat()));
  
          }
  </code></pre>
  
  <p>in OnActionExecuted method i get total time. how can i show this time in my <code>http://localhost:51335/Trace.axd</code> report?</p>
  
  <p>Even i had set <code>Trace="true"</code> in &lt;%@ Page %> on every page also.</p>