Improved Windows ClockGetMicroseconds precision

Former-commit-id: 601157e2116bc4f3ecd22ec89a285f62e4b36c11
This commit is contained in:
Lynix 2013-05-11 14:04:08 +02:00
parent 28f46a5c90
commit ad2c66bbb3
1 changed files with 3 additions and 3 deletions

View File

@ -21,13 +21,13 @@ bool NzClockImplInitializeHighPrecision()
nzUInt64 NzClockImplGetMicroseconds()
{
// http://msdn.microsoft.com/en-us/library/windows/desktop/ms644904(v=vs.85).aspx
HANDLE thread = GetCurrentThread();
DWORD oldMask = SetThreadAffinityMask(thread, 1);
//HANDLE thread = GetCurrentThread();
//DWORD oldMask = SetThreadAffinityMask(thread, 1);
LARGE_INTEGER time;
QueryPerformanceCounter(&time);
SetThreadAffinityMask(thread, oldMask);
//SetThreadAffinityMask(thread, oldMask);
return time.QuadPart*1000000ULL / frequency.QuadPart;
}