mirror of
https://github.com/thunderbrewhq/common.git
synced 2025-12-12 03:02:29 +00:00
fix(time): make thread affinity mask calculation more readable
This commit is contained in:
parent
9a3b3aeafd
commit
f0835fa1a7
1 changed files with 1 additions and 1 deletions
|
|
@ -63,7 +63,7 @@ TimingMethod OsTimeManager::Calibrate() {
|
||||||
GetProcessAffinityMask(process, &processAffinityMask, &systemAffinityMask);
|
GetProcessAffinityMask(process, &processAffinityMask, &systemAffinityMask);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < 512; i++) {
|
for (uint32_t i = 0; i < 512; i++) {
|
||||||
SetThreadAffinityMask(thread, 1 << static_cast<DWORD_PTR>(static_cast<uint8_t>(i % nproc) & 0x1F));
|
SetThreadAffinityMask(thread, static_cast<DWORD_PTR>(1UL << ((i % nproc) & 31UL)));
|
||||||
OsSleep(0);
|
OsSleep(0);
|
||||||
QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&pc2));
|
QueryPerformanceCounter(reinterpret_cast<LARGE_INTEGER*>(&pc2));
|
||||||
if (pc2 <= pc1) {
|
if (pc2 <= pc1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue