A simple Wait Function
![Visual Basic 6, or VB Classic Visual Basic 6, or VB Classic](https://www.fortypoundhead.com//assets/img/icons/v7/vb6.png)
Ur code waits for X seconds without stopping complete VB like most others (incl. Sleep Api)
Original Author: PrixM
Assumptions
'Set the API Declaration and the Code into a Module
'to use the function Wait(x) x stands for the amount of seconds to wait
API Declarations
Public Declare Function GetTickCount Lib "kernel32.dll" () As Long
Code
Public Function Wait(ByVal TimeToWait As Long) 'Time in seconds
Dim EndTime As Long
EndTime = GetTickCount + TimeToWait * 1000 '* 1000 Cause u give seconds and GetTickCount uses Milliseconds
Do Until GetTickCount > EndTime
DoEvents
Loop
End Function
Loading Comments ...
Comments
No comments have been added for this post.
You must be logged in to make a comment.