Timer

Response time function.

The Timer function returns the value of the specified clock. Not available in WinTask Lite.

Syntax

response_time=Timer(<clock_number>)

Parameters

<clock_number> : number of the clock from which response_time is retrieved ; valid values go from 1 to 10.

If <clock_number> is an invalid number, Error Handling rules are used.

Return value

response_time : value contained in <clock_number>, in 1/100 seconds. As system time is not accurate enough to measure 1/1000 sec, WinTask timers have a maximum precision of 1/100 sec.

See also

StartTimer, StopTimer, ResetTimer

Examples

This script measures a connection time : connection is supposed achieved when the text "connected" is displayed in the emulator window (window name : my_emulator$).

ResetTimer(1)

'After having reset clock number 1, start clock number 1
StartTimer(1)

Pause until

Text("connected")

InWindow(my_emulator$)

EndPause

'Stop the timer
StopTimer(1)

'Timer function returns the result as a number in 1/100 sec.
Comment("connection made in : "+str$(Timer(1)/10))

This script measures how long it takes for a page on www.wintask.com to load

ResetTimer(1)

StartBrowser("IE", "www.wintask.com")

UsePage("WinTask - Automation software and Task Scheduler. Macro software with Macro Recorder")

StartTimer(1)

ClickHTMLElement("A[INNERTEXT= 'How It Works']")

 

UsePage("WinTask - How it works")

'Stop the timer

StopTimer(1)

'Timer function returns the result as a number in 1/100 sec.

msgbox("Page How it works loaded in : "+str$(Timer(1))+" hundreds of a sec")