在 4/27/21 2:00 AM, Christian Franke 写道:

Which complexity do you mean - the extra cost of the system call or the extra 
15 lines of code?


It's actually both.

Wall clocks are not meant to be steady, because they are free to jump back and forth due to NTP synchronization, and arithmetic operations aren't predicable either due to leap seconds. Introduction of more overhead upon each call, for some unpredictable and unreliable accuracy, is futile.

There are also some issues in this patch. You can't assign a `void*` to a pointer-to-function. And you can't use `volatile` variables for synchronization; you have to use `_Atomic` which yet adds more complexity in code.



AFAICS, my patch would switch the Mingw-w64 column to '2'.

BTW: None of the above provide an extra high_resolution_clock:
GNU Libstdc++ Headers: using high_resolution_clock = system_clock;
Cygwin (Clang headers), MSVC16: using high_resolution_clock = steady_clock;


`high_resolution_clock` should call `QueryPerformanceCounter()` on Windows or `clock_gettime()` on POSIX systems. `gettimeofday()` is apparently not an option, as it is not suitable for measurement. The libstdc++ implementation should be considered faulty. I suggest people avoid its use.


--
Best regards,
Liu Hao

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to