Jump to content

Timer: Multiple Times output to file in a long script


Recommended Posts

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

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

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
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...