qelapsedtimer for WinRT

Change-Id: Ic31fa667bdc746776d8e29564ea8a1ba6e7384f3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Oliver Wolff 2013-09-05 10:22:01 +02:00 committed by The Qt Project
parent 1985f818e7
commit cfc7cc39f9

View File

@ -43,7 +43,11 @@
#include <qt_windows.h>
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
@ -56,6 +60,7 @@ static void resolveLibs()
if (done)
return;
#ifndef Q_OS_WINRT
// try to get GetTickCount64 from the system
HMODULE kernel32 = GetModuleHandleW(L"kernel32");
if (!kernel32)
@ -67,6 +72,7 @@ static void resolveLibs()
#else
ptrGetTickCount64 = (PtrGetTickCount64)GetProcAddress(kernel32, "GetTickCount64");
#endif
#endif // !Q_OS_WINRT
// Retrieve the number of high-resolution performance counter ticks per second
LARGE_INTEGER frequency;