Re: [PATCH] A steadier steady_clock

2012-10-21 Thread Sam Varshavchik
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 det

Re: [PATCH] A steadier steady_clock

2012-10-21 Thread Ulrich Drepper
On Sun, Oct 21, 2012 at 12:11 PM, Paolo Carlini wrote: \>> @@ -70,7 +70,11 @@ >> { >> timespec tp; >> // -EINVAL, -EFAULT >> +#ifdef CLOCK_MONOTONIC_RAW >> + clock_gettime(CLOCK_MONOTONIC_RAW, &tp); >> +#else >> clock_gettime(CLOCK_MONOTONIC, &tp); >> +#endif >> re

Re: [PATCH] A steadier steady_clock

2012-10-21 Thread Florian Weimer
* 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? > +#ifdef CLOCK_MONO

Re: [PATCH] A steadier steady_clock

2012-10-21 Thread Paolo Carlini
On 10/21/2012 04:00 PM, Sam Varshavchik wrote: 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, Something like this: Please always CC library patches to l

[PATCH] A steadier steady_clock

2012-10-21 Thread 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, Something like this: Index: libstdc++-v3/src/c++11/chrono.cc ===