'*******************************************
' Wait - by DarKPaiN
'
'w w w . P r o g e n i c . c o m
'*******************************************

Declare Function GetTickCount Lib "kernel32" () As Long


Sub Wait(TimeToWait As Variant)
Dim RetConst1 As Variant
Dim RetConst2 As Integer
Dim RetConst3 As Variant
RetConst1 = GetTickCount()
Do
    RetConst2% = DoEvents()
    RetConst3 = GetTickCount()
Loop Until RetConst3 - RetConst1 >= TimeToWait * 1000
End Sub