billheathco
Electrical
- Sep 17, 2015
- 1
Public Declare Function GetTickCount Lib "kernel32" () As Long
Public Sub wait(ByVal dblMilliseconds As Double)
Dim dblStart As Double
Dim dblEnd As Double
Dim dblTickCount As Double
dblTickCount = GetTickCount()
dblStart = GetTickCount()
dblEnd = GetTickCount + dblMilliseconds
Do
DoEvents
dblTickCount = GetTickCount()
Loop Until dblTickCount > dblEnd Or dblTickCount < dblStart
End Sub
I found this in another post and it works. However, when I tried to use it, I found that all execution in any other subroutine also stops. I need to stop processing the current routine while others complete. Any help would be appreciated.
Public Sub wait(ByVal dblMilliseconds As Double)
Dim dblStart As Double
Dim dblEnd As Double
Dim dblTickCount As Double
dblTickCount = GetTickCount()
dblStart = GetTickCount()
dblEnd = GetTickCount + dblMilliseconds
Do
DoEvents
dblTickCount = GetTickCount()
Loop Until dblTickCount > dblEnd Or dblTickCount < dblStart
End Sub
I found this in another post and it works. However, when I tried to use it, I found that all execution in any other subroutine also stops. I need to stop processing the current routine while others complete. Any help would be appreciated.