The Sleep method causes execution of the current script to be suspended for the specified number of milliseconds.
for (i=1; i<=5; i++)
{
WScript.Sleep(1000)
WScript.Echo("I started",i,"second(s)
ago.")
}
WScript.Echo("Now I'm done.")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.The use of the Sleep method is demonstrated in this JScript code.