oscilatingcretin
oscilatingcretin

Reputation: 10959

How can I get the total server AND client page load time?

I am measuring performance of an ASP.NET page. I need to measurement two parts: 1) The server page load time (to calculate the time it takes to bind controls from data loaded from database) and 2) measure the difference between the millisecond that the server's PageLoad event started and the millisecond that the client has finished loading (because I want to be able to calculate the time it took for the client browser to download and render the HTML).

Measuring the serverside load time is easy with the StopWatch class. The part I need advice for is capturing the date and time that the client has loaded.

Here's what I am doing in this order:

I do this so I can keep the client datetime in sync with the server datetime due to the fact that someone's machine time can easily be off by a few seconds. However, I think that AJAX call adds a little overhead itself which is counterproductive to performance measurement.

Is there an accurate method of using GMT to sync up the client time with the server time without having to report to the server to get it?

Upvotes: 1

Views: 436

Answers (1)

Oscar
Oscar

Reputation: 13990

About the server side, you can set Trace=true in Page directive

http://msdn.microsoft.com/en-us/library/94c55d08(v=vs.100).aspx

Upvotes: 0

Related Questions