Improved Windows ClockGetMicroseconds precision
Former-commit-id: 601157e2116bc4f3ecd22ec89a285f62e4b36c11
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user