This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #12515] Improve precision of clock function


On Tue, May 21, 2013 at 08:26:11PM +0530, Siddhesh Poyarekar wrote:
> Hi,
> 
> The current implementation of clock() uses times(), which only has
> millisecond precision.  Attached patch uses clock_gettime
> (CLOCK_PROCESS_CPUTIME_ID) if it is available so as to improve the
> precision to at least to the extent of CLOCKS_PER_SECOND, which comes
> to about a microsecond.  No regressions on x86_64.  I'll add a note in
> NEWS as well if this is acked.  OK to commit?
>
No, you said CLOCK_PROCESS_CPUTIME_ID but you wrote
> +  if (__clock_gettime (CLOCK_REALTIME, &ts) == 0)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]