Jump to content
Sign in to follow this  
westsan

Timer: Multiple Times output to file in a long script

Recommended Posts

westsan

I would appreciate if someone could give me a few hints as how to time multiple steps in a long series of steps and output the time to a file so that it can be compared.

For example I am testing iTunes with different types and volumes of data.

I want to run the random series or normal user cases and output how long each step takes (DL, transfer to collection/playlists, delete, transfer data to iPod, etc.)

I am a complete beginner

TIA

Share this post


Link to post
Share on other sites
martin

I would appreciate if someone could give me a few hints as how to time multiple steps in a long series of steps and output the time to a file so that it can be compared.

For example I am testing iTunes with different types and volumes of data.

I want to run the random series or normal user cases and output how long each step takes (DL, transfer to collection/playlists, delete, transfer data to iPod, etc.)

I am a complete beginner

TIA

You need to read up on

Timerinit, Timerdiff, @MIN, @Sec, @Hour and related for timings,

Fileopen, FileWriteLine, FileClose for the File IO and play with them.

EDIT:Spelling

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
westsan

Thanks. Im working on it.

Is there a more complete reference than the AutoIt3 Documentation

Im not finding good explanatins (for a layman) there

Share this post


Link to post
Share on other sites
westsan

Im not finding any examples anywere in the syntax required to use Timerdiff and Timerinit

Share this post


Link to post
Share on other sites
westsan

Wait a minute:

I just found the WinWaitActive command but I do not understand how I can use these:

text [optional] The text of the window to check.

timeout [optional] Timeout in seconds

WinWaitActive ( "title" [, "text" [, timeout]] )

I would like to output the time it takes to be active

Share this post


Link to post
Share on other sites
PsaltyDS

Wait a minute:

I just found the WinWaitActive command but I do not understand how I can use these:

text [optional] The text of the window to check.

timeout [optional] Timeout in seconds

WinWaitActive ( "title" [, "text" [, timeout]] )

I would like to output the time it takes to be active

WinWaitActive() will not give you time elapsed. You need your own timer. TimerInit() takes no parameters at all, and only initializes a variable you provide. TimerDiff() only takes one parameter, the variable you previously initialized with the "start time", and returns the elapsed time in milliseconds.

Run("notepad.exe")
$Timer = TimerInit()
WinWaitActive("Untitled - Notepad", "")
$Elapsed = TimerDiff($Timer)
MsgBox(64, "Time", "Notepad took " & $Elapsed / 1000 & " seconds to become active.")

:)

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.