README.md
December 4, 2022 ยท View on GitHub
Description
Ur code waits for X seconds without stopping complete VB like most others (incl. Sleep Api)
More Info
'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
| Submitted On | |
| By | PrixM |
| Level | Beginner |
| User Rating | 4.3 (39 globes from 9 users) |
| Compatibility | VB 4.0 (32-bit), VB 5.0, VB 6.0 |
| Category | VB function enhancement |
| World | Visual Basic |
| Archive File |
API Declarations
Public Declare Function GetTickCount Lib "kernel32.dll" () As Long
Source 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