Refactor preciseSleep for improved timing accuracy and reduce busy-wait duration on Windows

This commit is contained in:
ImBenji
2025-11-23 18:08:45 +00:00
parent 8125f8ebd7
commit f5a23fa5c4
2 changed files with 5 additions and 7 deletions

View File

@@ -39,7 +39,7 @@ void spawnTicket(RandomAccessFile file, {
int count = expSleepTracker[label] ?? 0;
int sleepTime = (1 << count); // Exponential backoff
// sleepTime = max(1, min(sleepTime, 1000)); // Clamp between 1ms and 1000ms
preciseSleep(Duration(microseconds: sleepTime * 5000));
preciseSleep(Duration(microseconds: sleepTime * 1000));
expSleepTracker[label] = count + 1;
}