https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63400

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to frankhb1989 from comment #4)
> With mingw-w64, the following program shows that the monotonic clock is far
> more precise:
> 
> #include <pthread_time.h>
> #include <iostream>
> 
> int main()
> {
>       using namespace std;
>       timespec ts;
> 
>       if(clock_getres(CLOCK_REALTIME, &ts) == 0)
>               cout << "CLOCK_REALTIME: " << ts.tv_sec << ',' << ts.tv_nsec << 
> endl;
>       if(clock_getres(CLOCK_MONOTONIC, &ts) == 0)
>               cout << "CLOCK_MONOTONIC: " << ts.tv_sec << ',' << ts.tv_nsec 
> << endl;
> }
> 
> The result on my machine:
> 
> CLOCK_REALTIME: 0,15625000
> CLOCK_MONOTONIC: 0,489

Is this still an issue in 2022?

Using a mingw-w64 cross-compiler and running under Wine I get:

CLOCK_REALTIME: 0,100
CLOCK_MONOTONIC: 0,100

Is that just because I'm using Wine not real Windows?

Reply via email to