Jump to content

Measuring program startup time


Recommended Posts

Hi guys, I have a problem involving measuring the time it takes a program to load.

I'm writing a script that launches a program, records the time, and then ends the time when the program is responsive(I.E, you can move the mouse and all the buttons work).

Since WinWait wasn't working, I tried using ControlCommand with IsVibible on certain buttons,

the problem with this approach is that buttons are visible before they are responsive?

What is the best way to go about solving this problem? Should I use getpixelcolor or something?

Best,

Athos

Link to comment
Share on other sites

So after further testing, it seems like isEnabled this doesn't work consistently, and I'm back to the drawing board...

The code im using now looks like this:

$sEnabled=ControlCommand ( $sAppTitle, "", "[CLASS:MenuBar; INSTANCE:1]", "IsEnabled")

MsgBox(0, "Visibility", $sEnabled)

While $sEnabled <>1

$sEnabled=ControlCommand ( $sAppTitle, "", "[CLASS:MenuBar; INSTANCE:1]", "IsEnabled")

MsgBox(0, "Enabled?", $sEnabled)

;get stuck in the loop

WEnd

MsgBox(0, "outtadaloop", $sEnabled)

I've found that waiting for a window to close gives an accurate time assment for testing. The problem here is there is no window that closes....

Thoughts?

Edited by Athos
Link to comment
Share on other sites

So for anybody wondering how to answer this question I did write a solution...albeit a weird one.

What I do is write a while loop that tries to activate the window...

When the window finally comes up it activates it and exits the loop.

I then enter a series of keys, the contents of which doesn't matter,

because the program is loading, it is unable to handle the request of the keys.

This causes the program to not respond, and the the buttons that were enabled to be not enabled.

I then have another while loop that keeps checking if the button is enabled,

and when the program final becomes responsive, it exit the loop.

This all gives me an accurate time for startup.

If anybody has a better, simpler method of doing this, let me know. :D

Link to comment
Share on other sites

  • 1 year later...

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

×
×
  • Create New...