winpr: add high-precision GetTickCountPrecise for Windows.
This commit is contained in:
parent
07407927c2
commit
ad4cdf8810
@ -295,6 +295,8 @@ WINPR_API ULONGLONG GetTickCount64(void);
|
||||
|
||||
#endif
|
||||
|
||||
WINPR_API DWORD GetTickCountPrecise(void);
|
||||
|
||||
WINPR_API BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature);
|
||||
|
||||
/* extended flags */
|
||||
|
@ -678,6 +678,21 @@ BOOL IsProcessorFeaturePresent(DWORD ProcessorFeature)
|
||||
|
||||
#endif //_WIN32
|
||||
|
||||
DWORD GetTickCountPrecise(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
LARGE_INTEGER freq;
|
||||
LARGE_INTEGER current;
|
||||
|
||||
QueryPerformanceFrequency(&freq);
|
||||
QueryPerformanceCounter(¤t);
|
||||
|
||||
return (DWORD) (current.QuadPart * 1000LL / freq.QuadPart);
|
||||
#else
|
||||
return GetTickCount();
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOL IsProcessorFeaturePresentEx(DWORD ProcessorFeature)
|
||||
{
|
||||
BOOL ret = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user