Jump to content

Timer usae for getting correct navigation time


Recommended Posts

Hi,

I am currently using autoit3. I am working on a script which will give the time to navigate from one page to another page in IE after linking on link/button.

But I observed that the navigation time from Page 1 to Page 2 is coming exactly same as navigation time from page 2 to page 3.

However its highly impossible that the navigation time always be same between two page all the time.

I tried to use TimerInit(), TimerDiff() function and later I changed to below code

Local $starttime = _Timer_Init ()
   _IELinkClickByText($oIE, "Today's Deals")
   _IELoadWait($oIE)
   $ActTime2 = Round(_Timer_Diff($starttime),0)
   $starttime=0
   
Sleep(2000)
   Local $starttime = _Timer_Init ()
   $starttime=0
   _IELinkClickByText($oIE, "personalized deals")
   _IELoadWait($oIE)
   $ActTime3 = Round(_Timer_Diff($starttime),0)
 
but all these functions are giving me same results.
 
 
Please help in getting correct navigation time in milliseconds.
 
 
 
Regards,
Ashish
Link to comment
Share on other sites

Can't see the trouble... your code works, using the integrated Timer* funcs

#include <IE.au3>
$oIE = _IECreate ( "http://www.autoitscript.com/forum/")

Local $starttime = TimerInit ()
   _IELinkClickByText($oIE, "Downloads")
   _IELoadWait($oIE)
   $ActTime2 = Round(TimerDiff($starttime),0)
 ;  $starttime=0
   
Sleep(2000)
   Local $starttime = TimerInit ()
 ;  $starttime=0
   _IELinkClickByText($oIE, "Wiki")
   _IELoadWait($oIE)
   $ActTime3 = Round(TimerDiff($starttime),0)

msgbox(0,"", $ActTime2 &@crlf& $ActTime3)
Edited by mikell
Link to comment
Share on other sites

HI Mikell,

Thanks a lot for your quick response. I understand this but as I mentioned, I tried to use TimerInit(), TimerDiff() functions as well but if you try then will find that both are working same and there is NO difference in output.

steps would be link this.

1 launch IE with some URL

2. wait for it to load completely and

3. then run the above code by changing Link text.

 

Regards,

Ashish

Link to comment
Share on other sites

 

HI Mikell,

Thanks a lot for your quick response. I understand this but as I mentioned, I tried to use TimerInit(), TimerDiff() functions as well but if you try then will find that both are working same and there is NO difference in output.

steps would be link this.

1 launch IE with some URL

2. wait for it to load completely and

3. then run the above code by changing Link text.

 

Regards,

Ashish

Link to comment
Share on other sites

Is there a reason you quoted your own post? Also, unless you absolutely have to, you don't really need to quote another post as we can all read what's there. Sometimes you should quote if what you're replying to have numerous points and you want to respond to each of them separately.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

#include <IE.au3>
$oIE = _IECreate ( "http://www.autoitscript.com/forum/")

Local $starttime = TimerInit ()
   _IELinkClickByText($oIE, "Downloads")
   _IELoadWait($oIE)
   $ActTime2 = Round(TimerDiff($starttime),3)
 ;  $starttime=0
   
Sleep(2000)
   Local $starttime = TimerInit ()
 ;  $starttime=0
   _IELinkClickByText($oIE, "Wiki")
   _IELoadWait($oIE)
   $ActTime3 = Round(TimerDiff($starttime),3)

msgbox(0,"", $ActTime2 &@crlf& $ActTime3)

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...