How do i make an execution of program wait for n seconds? where n could be any Integer..
is there Sleep or pause or wait like command in VB6?
I know there's sleep in VB.net,
you can declare it:
Public Shared Sub Sleep (millisecondsTi meout As Integer)
it's not that hard (the only problem is that you wont be able to sleep for more than 32 seconds, because of the integers size restrictions)
in case this doesnt help in VB6, or you need something better... hmm, may be something with DoEvents will do:
[CODE=vb]public sub Sleep(sleepTime as single)
dim t as single
t= timer
do
doevents
loop until (t + sleeptime >= timer)
end sub[/CODE]
sleepTime is in seconds ^.~
Note: dont ever use this near midnight (hahahaha, that sounded like a gremlin), because Timer is the seconds that have passed today, so if it stills sleeping after midnight, it'll never wake up!! mua ha ha ha.
Last edited by kadghar; Mar 11 '08, 12:41 AM.
Reason: Adding a note
Comment