VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

The most accurate method of Timing from Visual Basic

BigCalm  (10 Submissions)   Miscellaneous   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

By using the "Performance Timer" in all modern PC's it is possible to achieve timing accuracy of greater than one microsecond (yes, 1 millionth of a second). This code shows you how to use API calls to access and use it.

API Declarations
' Unsigned 64-bit long
Public Type LongLong
LowPart As Long
HighPart As Long
End Type
Declare Function QueryPerformanceCounter Lib "kernel32" _
(lpPerformanceCount As LongLong) As Long
Declare Function QueryPerformanceFrequency Lib "kernel32" _
(lpFrequency As LongLong) As Long
Declare Function timeGetTime Lib "winmm.dll" () As Long

Rate The most accurate method of Timing from Visual Basic (3(3 Vote))
The most accurate method of Timing from Visual Basic.bas

The most accurate method of Timing from Visual Basic Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters