1

Is there any way to programmatically measure load time of webpage in IE window? Can C# console application "connect" to IE window and measure load time and maybe size of a page?

Console application will be working in the background. When user opens new IE window and types specified address in address bar, application should measure page load time.

Thanks in advance for your replies. Regards

Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674
user1013552
  • 313
  • 2
  • 5
  • 14
  • What about Shdocvw.dll? I think it can be done this way. I know how to create new instance of IE - the problem is how to connect to an existing window od IE... – user1013552 Oct 26 '11 at 18:49

2 Answers2

1

Not the way you're describing it. You'd have to do a lot of plumbing and working with pInvoke to get the console application to recognize when the page is done loading in IE if it can be done at all.

However, you could have the Console application load the page and get the size itself using the System.Net.WebClient class. (code sample at the bottom of the page linked to).

You could measure the amount of time it takes in your class by declarring two DateTime valies, and setting each to DateTime.Now - one before, and one after the call to get the page, and then compare the difference.

You can also get the size of the page by getting the number of bytes retrieved.

If you don't want to write your own client for this, there are two other previous answers to how to measure page load time here: How do you measure page load speed? and here: What is the best way to measure Client Side page load times?

Be sure to vote them up if you use their answers.

Community
  • 1
  • 1
David
  • 72,686
  • 18
  • 132
  • 173
0

What you need is a tool that does Real User Monitoring (RUM).

If you want to use an off the shelf solution have a look at something like NewRelic.

Other alternatives are to roll your own using boomerang.js (it's on GitHub) and extract the timing data from the web server logs.

Andy Davies
  • 5,794
  • 2
  • 26
  • 21