qelapsedtimer for WinRT
Change-Id: Ic31fa667bdc746776d8e29564ea8a1ba6e7384f3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
1985f818e7
commit
cfc7cc39f9
@ -43,7 +43,11 @@
|
|||||||
#include <qt_windows.h>
|
#include <qt_windows.h>
|
||||||
|
|
||||||
typedef ULONGLONG (WINAPI *PtrGetTickCount64)(void);
|
typedef ULONGLONG (WINAPI *PtrGetTickCount64)(void);
|
||||||
static PtrGetTickCount64 ptrGetTickCount64 = 0;
|
#if defined(Q_OS_WINRT)
|
||||||
|
static const PtrGetTickCount64 ptrGetTickCount64 = &GetTickCount64;
|
||||||
|
#else
|
||||||
|
static PtrGetTickCount64 ptrGetTickCount64 = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
@ -56,6 +60,7 @@ static void resolveLibs()
|
|||||||
if (done)
|
if (done)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifndef Q_OS_WINRT
|
||||||
// try to get GetTickCount64 from the system
|
// try to get GetTickCount64 from the system
|
||||||
HMODULE kernel32 = GetModuleHandleW(L"kernel32");
|
HMODULE kernel32 = GetModuleHandleW(L"kernel32");
|
||||||
if (!kernel32)
|
if (!kernel32)
|
||||||
@ -67,6 +72,7 @@ static void resolveLibs()
|
|||||||
#else
|
#else
|
||||||
ptrGetTickCount64 = (PtrGetTickCount64)GetProcAddress(kernel32, "GetTickCount64");
|
ptrGetTickCount64 = (PtrGetTickCount64)GetProcAddress(kernel32, "GetTickCount64");
|
||||||
#endif
|
#endif
|
||||||
|
#endif // !Q_OS_WINRT
|
||||||
|
|
||||||
// Retrieve the number of high-resolution performance counter ticks per second
|
// Retrieve the number of high-resolution performance counter ticks per second
|
||||||
LARGE_INTEGER frequency;
|
LARGE_INTEGER frequency;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user