sumit Posted July 18, 2007 Share Posted July 18, 2007 Can anyone please give me the code to display in a message box the time taken to load a page in IE. Thanks Link to comment Share on other sites More sharing options...
herewasplato Posted July 18, 2007 Share Posted July 18, 2007 Can anyone please give me the code to display in a message box the time taken to load a page in IE. ThanksYou might want to learn how to search the help file. In this case, I searched for time and wait: #include <IE.au3> $begin = TimerInit() $oIE = _IECreate("http://www.cnn.com") _IELoadWait($oIE) $dif = TimerDiff($begin) MsgBox(0, "Time Difference", $dif) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
sumit Posted July 18, 2007 Author Share Posted July 18, 2007 Thanks a lot dear ..... Also your suggestion for searching helpfile is correct..... I tried to search but couldnt find it......thanks again Link to comment Share on other sites More sharing options...
herewasplato Posted July 18, 2007 Share Posted July 18, 2007 The _IELoadWait($oIE) line is not needed as it is built into the _IECreate function via the IENavigate UDF. #include <IE.au3> $begin = TimerInit() $oIE = _IECreate("http://www.cnn.com") ;_IELoadWait($oIE) $dif = TimerDiff($begin) MsgBox(0, "Time Difference", $dif) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
herewasplato Posted July 18, 2007 Share Posted July 18, 2007 ...and this version should take the browser window creation time out of the equation:#include <IE.au3> $oIE = _IECreate("about:blank") $begin = TimerInit() _IENavigate($oIE, "http://www.cnn.com") $dif = TimerDiff($begin) MsgBox(0, "Time Difference", $dif) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
herewasplato Posted July 18, 2007 Share Posted July 18, 2007 Having walked you thru all of that, you might find it better to use InetGet and set the reload parm to "1 = Forces a reload from the remote site" to avoid IE temp file cache issues.Also note that it takes time for a computer and browser to render (paint/show) the page you requested - meaning, if you use the _IECreate/_IENavigate method mentioned in my previous posts on slow hardware, you will see a difference in the "load time". The difference will be relative, so you might still find it of some use, but InetGet should be less influenced by hardware.That "time to render" is part of this site's speed test:http://www.numion.com/YourSpeed3/Select.phpSee the brief explanation of MaxSpeed and SurfSpeed near the bottom of that page. [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
sumit Posted July 18, 2007 Author Share Posted July 18, 2007 Thanks a lot Link to comment Share on other sites More sharing options...
herewasplato Posted July 19, 2007 Share Posted July 19, 2007 Thanks a lotYou are welcome... but if you run this code, you might see that a lot of the variation is not the fault of the proxy.TrayTip("", "working", 100) $begin = TimerInit() InetGet("http://infospeed.verizon.net/car/data5MB.zip", "tempfile", 1) $dif1 = TimerDiff($begin) TrayTip("", "time1 " & Int($dif1), 100) $begin = TimerInit() InetGet("http://infospeed.verizon.net/car/data5MB.zip", "tempfile", 1) $dif2 = TimerDiff($begin) TrayTip("", "time1 " & Int($dif1) & @CR & _ "time2 " & Int($dif2), 100) $begin = TimerInit() InetGet("http://infospeed.verizon.net/car/data5MB.zip", "tempfile", 1) $dif3 = TimerDiff($begin) TrayTip("", "time1 " & Int($dif1) & @CR & _ "time2 " & Int($dif2) & @CR & _ "time3 " & Int($dif3), 100) FileDelete("tempfile") Sleep(22222) [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now