[PATCH] A steadier steady_clock

Sam Varshavchik mrsam@courier-mta.com
Mon Oct 22 01:54:00 GMT 2012


Florian Weimer writes:

> * Sam Varshavchik:
>
> > Based on a casual browsing of clock_gettime(3), CLOCK_MONOTONIC_RAW
> > seems to be a better fit for std::chrono::steady_clock's requirements
> > as given in  20.11.7.2, with recent Linux kernels,
>
> Are the Linux clock semantics documented somewhere in detail?

clock_gettime(3) says:

# CLOCK_MONOTONIC_RAW (since Linux 2.6.28; Linux-specific)
# Similar  to  CLOCK_MONOTONIC, but provides access to a raw hard‐
# ware-based time that is not subject to NTP adjustments.

That looks like a better fit for what 20.11.7.2 says steady_clock should be.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20121022/b5b3b58b/attachment.sig>


More information about the Libstdc++ mailing list