Discussion:
[Mingw-users] clock_gettime
DAVENPORT, MARC
2017-05-28 22:38:54 UTC
Permalink
Is there any chance of clock_gettime being implemented in MinGW? MinGW64
has it but I don't like MinGW64. Source code is public domain. See link
below. It would also need at least clockid_t and clock_getcpuclockid.

https://github.com/mirror/mingw-w64/blob/master/mingw-w64-libraries/winpthreads/src/clock.c#L109

http://pubs.opengroup.org/onlinepubs/009695399/basedefs/time.h.html

Marc
Peter Rosin
2017-05-29 07:30:08 UTC
Permalink
Is there any chance of clock_gettime being implemented in MinGW? MinGW64 has it but I don't like MinGW64. Source code is public domain. See link below. It would also need at least clockid_t and clock_getcpuclockid.
https://github.com/mirror/mingw-w64/blob/master/mingw-w64-libraries/winpthreads/src/clock.c#L109
Hmm, their CLOCK_MONOTONIC wraps, and rather quickly too on some machines [1]; it's
nothing more than a dirty hack as it's not monotonic at all.

Unless I'm missing something non-obvious...

Cheers,
Peter

[1] I've seen machines wrap the performance counter within the hour, albeit many
years ago, but the non-handling of the fundamental timer wrap problem persists.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-***@lists.sourceforge.net

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-***@lists.sourceforge.net?subject=unsubscribe
Continue reading on narkive:
Loading...