The power of timer based calls in AutoIt3
Inspired by JS.
You can now request a function to be called once or repeatedly with up to 9 parameters.
#include "Timer.au3"
setTimeout('MyExit', 10000)
setTimeout('MsgBox', 5000, 0, "title", "message")
setInterval('WriteTime', 1000)
Func WriteTime()
ConsoleWrite(StringFormat("%02i:%02i:%02i.%03i\n", @HOUR, @MIN, @SEC, @MSEC))
EndFunc
Func MyExit()
Exit
EndFunc
While 1
Sleep(10)
WEnd
call function once after a defined duration
syntax | ||
---|---|---|
setTimeout($function [, $delay = 0 [, $arg1 [, $arg2 [, $arg3 [, $arg4 [, $arg5 [, $arg6 [, $arg7 [, $arg8 [, $arg9]]]]]]]]]) |
||
arguments | ||
variable | type | description |
$function | string | function name |
$delay | integer | call delay in milliseconds |
$arg1...$arg9 | mixed | arguments to be passed to the function call |
return | ||
type | description | |
integer | Timer ID |
call function repeatedly after a defined duration
if the called function sets @error <> 0 then the setInterval will be cancelled
syntax | ||
---|---|---|
setInterval($function [, $delay = 0 [, $arg1 [, $arg2 [, $arg3 [, $arg4 [, $arg5 [, $arg6 [, $arg7 [, $arg8 [, $arg9]]]]]]]]]) |
||
arguments | ||
variable | type | description |
$function | string | function name |
$delay | integer | call delay in milliseconds |
$arg1...$arg9 | mixed | arguments to be passed to the function call |
return | ||
type | description | |
integer | Timer ID |