Put a Delay in your Code. 
Author Message
 Put a Delay in your Code.

> Does this "sleep" code allow the application to respond to "other events"
> fired within the same application?

No it doesn't, Sleep completely suspends the application.  Perhaps this is
a weakness, but I don't think so.  If you need a delay midprocess and want
to issue DoEvents you could do just Sleep for 10 milliseconds at a time(or
more depending on what you what) like this:

Public Declare Sub SleepAPI Lib "kernel32" Alias "Sleep" (ByVal
dwMilliseconds As Long)

Private Sub Sleep(MillisecondsToSleep as Long)
        Dim iIterations as Long
        Dim iCount as Long

        iterations = MillisecondsToSleep / 10
        For iCount = 1 to iIterations
                SleepAPI 10
        Next iCount

End Sub

Shawn Brock

Sun, 05 Aug 2001 03:00:00 GMT  
 [ 4 post ] 

 Relevant Pages 

1. Put a Delay in your Code.

2. how to put a delay in your code ?

3. Sending a delayed email and have the time sent at the delayed time

4. code to delay for 1 second its operation

5. Code signing template introduces ~5 second delay

6. A code for a delay, Is there?

7. code for delay

8. delaying code

9. Delay code for WinExec

10. How can I code a delay...

11. Code snippet for minutes and seconds delay

12. Delay in code


Powered by phpBB® Forum Software