On Thu Jul 11 15:09:15 2024 +0000, Tatsuyuki Ishi wrote:
Yeah, I’m aware that detecting Wine isn’t a good approach in general. I’ll probably move to a Unixlib just for sleeping (kinda silly but that’s the most reliable). I already use waitable timers on Windows and they give 0.5ms precision from my tests. There are also other sources on the internet confirming the same thing [1](https://groups.google.com/a/chromium.org/g/scheduler-dev/c/0GlSPYreJeY?pli=1).
@ishitatsuyuki I looked at the `NtDelayExecution` code, we can easily get rid of calling `NtQuerySystemTime`. Probably in Windows there is no indication anywhere that we must call `NtQuerySystemTime` in `NtDelayExecution`. I think we can use `CLOCK_MONOTONIC` there, if its accuracy is not enough, then try using `CLOCK_PROCESS_CPUTIME_ID`.