views:

298

answers:

4

Hi All

I would like to know if there is a simple way of measuring the time it takes from when you hit Enter, to the time where a web page is fully displayed/loaded. Would I need to use a Timer for this, or are there existing features built into the Web Browser control (or .net framework) that I have missed out on?

Thank you

A: 

A simple google search reveals all :)

Timing a Page Load C#

Essentialy you are just recording the time at the start of Page_Load and at the end and using some simple math to work out the difference, there is your load time

Yoda
The OP is not in asp.net land. He wants to time how long it takes for a webbrowser control to load some page.
klausbyskov
Misunderstood, fair one.
Yoda
+1  A: 

Firebug (extension for Firefox) has a timing panel, under the "Net" tab.

Hans Kesting
Why the downvote for something that shows the time until the page is fully displayed?
Hans Kesting
+5  A: 

If you have control over the ASP.NET page, you could turn on Trace. There you will get a bunch of information about the Page lifecycle( including time stamps), and other useful profiling information.

Turn on trace for a page in the Page directive at the top of your aspx file:

<%@ Page Trace="true" %>

Or dynamically in code:

Trace.IsEnabled = true;

Or globally in the app setting this in web.config:

<configuration>
 <system.web>
  <trace enabled="true" requestLimit="40" localOnly="false"/>
 </system.web>
</configuration>

Also see the MSDN documentation for Trace.

awe
Thank you for your help, awe. Cool link :)
lucifer
But this only shows the time until asp.net is done with the request. You miss the time it takes to send this to the browser and have it rendered there.
Hans Kesting
+1  A: 

Fiddler can inspect all web requests and show you the relevant timings.

ck
Any reason for the drive-by -1?
ck