Hey all, a quick question here. I found this function on Planet Source Code which let's you sort of pause the program, but not completely stop it. I use this function in my winsock control code so I can send out several pieces of data without having them all overlap and what not.

Now, I've been using this function, as I said, in the form of "timedPause 1". But, now that my program is nearing completion and almost ready for beta test, this one second pause is becoming too large. Basically, all I'm needing is just a few miliseconds of time to pass, but this function only gives me the option of a minimum of that one second.

Can anyone tell me how to modify this function so I can 'freeze' for miliseconds instead of seconds? I'd greatly appreciate it, thanks.

Code:
Option Explicit
Public exitPause As Boolean


Public Function timedPause(secs As Long)
    Dim secStart As Variant
    Dim secNow As Variant
    Dim secDiff As Variant
    Dim Temp%
    
    exitPause = False 'this is our early way out out of the pause
    
    secStart = Format(Now(), "mm/dd/yyyy hh:nn:ss AM/PM") 'get the starting seconds
    


    Do While secDiff < secs
        If exitPause = True Then Exit Do
        secNow = Format(Now(), "mm/dd/yyyy hh:nn:ss AM/PM") 'this is the current time and Date at any itteration of the Loop
        secDiff = DateDiff("s", secStart, secNow) 'this compares the start time With the current time
        Temp% = DoEvents
    Loop
End Function
- Evan (Okaria)