WScript Object
Method: WScript.Sleep
WScript.
Sleep
lngTime
The
Sleep
method causes execution of the current script to be suspended for the specified number of milliseconds.
The use of the
Sleep
method is demonstrated in the following JScript code.
Code:
for (i=1; i<=5; i++)
{
WScript.Sleep(1000)
WScript.Echo("I started",i,"second(s) ago.")
}
WScript.Echo("Now I'm done.")
Output:
I started 1 second(s) ago.
I started 2 second(s) ago.
I started 3 second(s) ago.
I started 4 second(s) ago.
I started 5 second(s) ago.
Now I'm done.
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information