
Try this
In ASP.NET, this can be achieved using the application class which acts as an entry point for all incoming requests.
Use the below piece of code in the global.asax.cs file
protected void Application_BeginRequest(Object sender, EventArgs e) {
Context.Items.Add("StartTime", DateTime.Now);
}
Application_BeginRequest event is use to start the measurement of the time spent on the server-side process.
protected void Application_EndRequest(Object sender, EventArgs e)
{
var ts = DateTime.Now.Subtract((DateTime)Context.Items["StartTime"]);
Response.Write("<h6>Page load time " + ts + "ms</h6>");
}
This calculate the elapsed time on the webform's.
Hope this helps.
--
Thanks & Regards,
RNA Team
Amatya, if this helps please login to Mark As Answer. | Alert Moderator