On Thu Jul 11 12:51:07 2024 +0000, Grigory Vasilyev wrote:
Show at least one test script that indicates the need to undo a commit that is more than 5 years old. You also just need to delete the desired section of code or unset `CLOCK_REALTIME_COARSE`, instead of completely undoing the commit. Would like to see tests showing the rationality of completely undoing a commit.
#ifdef CLOCK_REALTIME_COARSE struct timespec res; /* Use CLOCK_REALTIME_COARSE if it has 1 ms or better resolution */ if (!clock_getres( CLOCK_REALTIME_COARSE, &res ) && res.tv_sec == 0 && res.tv_nsec <= 1000000) clock_id = CLOCK_REALTIME_COARSE; else #endif /* CLOCK_REALTIME_COARSE */
Both a clean revert or removing the CLOCK_REALTIME coarse path are reasonable ways to achieve the goal. We can go for endless bikeshed but the outcome is the same.
I've provided sufficient justification in the commit message. If you want to craft a test case, you can do one by measuring the accuracy of NtDelayExecution. BTW, one of the reason I want this is because I want count on NtDelayExecution being accurate on Wine (but not on Windows). I'm developing a frame limiter specific for Proton use and that allows me to accurately sleep without all the redundant spinning to compensate for native Windows' poor timer accuracy.