values must be signed, to handle negative numbers, my bad

This commit is contained in:
Ian Curtis 2022-06-14 21:24:43 +00:00
parent 78eab65749
commit e3bc56c8f1

View file

@ -851,7 +851,7 @@ static void SuperSleepUntil(uint64_t target)
// Compute the whole number of millis to sleep. Because OS sleep is not accurate, // Compute the whole number of millis to sleep. Because OS sleep is not accurate,
// we actually sleep for one less and will spin-wait for the final millisecond. // we actually sleep for one less and will spin-wait for the final millisecond.
uint32_t numWholeMillisToSleep = uint32_t((target - time) * 1000 / s_perfCounterFrequency); int32_t numWholeMillisToSleep = int32_t((target - time) * 1000 / s_perfCounterFrequency);
numWholeMillisToSleep -= 1; numWholeMillisToSleep -= 1;
if (numWholeMillisToSleep > 0) if (numWholeMillisToSleep > 0)
{ {