by AmineHaddad (4 Submissions)
Category: Windows API Call/Explanation
Compatability: VB Script
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating:
(3 Votes)
Most people use GetTickCount, but to be honest this makes GetTickCount look like a joke. QueryPerformanceCounter finds the time in microseconds, and not milliseconds (like GetTickCount). Why use this? If you wanted to see the time that it took for the cpu to proccess an API call, GetTickCount would find 0, because it takes less then a millisecond. But QueryPerformanceCounter would find the real time. I suggest using this because it is much more precise.
API DeclarationsPrivate Declare Function QueryPerformanceFrequency Lib "kernel32" (lpFrequency As Currency) As Long
Private Declare Function QueryPerformanceCounter Lib "kernel32" (lpPerformanceCount As Currency) As Long
Download QueryPerformanceCounter API Call Fully Explained (2 KB)