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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

waiting a time period without exiting from subroutine

Status
Not open for further replies.

krackers

Technical User
Oct 23, 2002
2
AU
I want to wait an exact period (say 100 milliseconds) of time in the program without relinquishing control from my subroutine to a timer control, so as not to lose local variables.

How do I do this? is there an inbuilt function for this?

thanks,
krackers
 
There is a simple API code you can call to handle this.
Place this in the declaration section of your code:
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Then when you want to wait (say for 100ms) call it by inserting the line:
Code:
Sleep 100
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top