Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
-
10.3.6-1
Description
Currently, we're using GetSystemTimesFileTime for high resolution timers.
Unfortunately, it is using system timer with accuracy 10ms to 55ms according to https://blogs.msdn.microsoft.com/oldnewthing/20170921-00.
For system versioning, we need a more accurate timer, this is what GetSystemTimePreciseAsFileTime provides, but this is not available
prior to Windows 8.1. We can use dynamic loading and fallback to non-precise variation on
downlevel Windows.
Note: there is a higher cost associated with precise function. my_hrtime() is used in many places, that may be performance relevant, most notably in pthread_condition_timedwait() Windows port, where it is used twice per pthread_condition_timedwait call. Thus pthread_cond_timedwait, and surrounded code should be reimplemented to use the cheap timer .