Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sleep Function

Status
Not open for further replies.

gustaf111

Programmer
Jan 16, 2011
87
SE
Hello all,

Are there any sleep function available in VBS ? I can not find any ... I would like to sleep 100 ms för eaxh stepp in a for loop.

For i = 1 to 10
...
...
"Sleep 100 ms"
Next

Gustaf

 
WScript.Sleep 100

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV,

I have tried that but is does not seem to work, it just pass without sleeping :(
 
I checked again and the loop only runs one time when I insert WScript.Sleep 100 last in the loop.

Gustaf
 
that's because the time is so short, you may not notice it.
10 times 100 mili-second amounts to one second. that's all you see.
you may try this:
Code:
for i = 1 to 10
    msgbox "going to sleep"
    wscript.sleet 100
    msgbox "coming out of sleep"

next
you will see that it stleeps 10 times for a duration of 100 ms.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top