Code: Select all
Debug ElapsedMilliseconds()
Debug GetTickCount_()More problematic, and this is just to show problem, is that GetTickCount_() seems to not actually count the milliseconds.
What is difference between to api call and pb function to get different results?
Code: Select all
; GetTickCount_() results in timing less than sleep/delay
For x = 1 To 10
a = GetTickCount_()
Delay(3241) ; or use Sleep_(3241) -- result is the same
Sleep_(3241)
b = GetTickCount_()
Debug b-a ; this answer (for me) is 3234 or 3235 or 3250 (usually less than 3241)
Next
Debug "----------------------"
; this almost always right answer
For x = 1 To 10
a = ElapsedMilliseconds()
Delay(3241)
b = ElapsedMilliseconds()
Debug d-c ; this answer is almost always 3241, occasionally 3242
Next

