Setup guide

SetTimer method
Set a timer
SetTimer(
sTimerName, nTimeOut
)
Arguments
sTimerName
Required. The timer name
nTimeOut
Required. TimeOut value in milliseconds.
Remarks
After a timer runs out (i.e. after nTimeOut milliseconds), a function in the script with the same name as sTimerName is
called.
After calling the SetTimer method, the script remains in memory (including all variables) until the timer runs out or the
KillTimer method is called.
JScript example:
TestVar="The Timer"; //set a string variable used later in the timer function
function MyTimer() //the timeout function. Note the name
{
Alert(TestVar); //TestVar is still valid
}
SetTimer("MyTimer",2000); //set the timer to call MyTimer() after 2 seconds
Each script that uses SetTimer must have an appropriate timer function. The timer name is global and can be used in
different scripts across commands and applications.
If you call SetTimer from two different scripts, the timer function in the last executed script will be called.
Let's say script A calls SetTimer. After script A has been executed, script B calls SetTimer with the same sTimerName
as script A. This causes script A to be deleted from memory (including all its variables) and replaced by script B. The
timer function of script B will be called after the timeout. If you need to pass variables from one script to another, use the
Globals object.
See Also
KillTimer
Sleep method
Suspends script execution for a specified time
Sleep(
nMilliSecs
)