]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
clock.3: The switch to the use of clock_gettime() was to improve *accuracy*
authorMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 14 Sep 2014 02:29:26 +0000 (19:29 -0700)
committerMichael Kerrisk <mtk.manpages@gmail.com>
Sun, 14 Sep 2014 02:35:37 +0000 (19:35 -0700)
Quoting Vincent Lefevre:

    In glibc 2.17 and earlier, clock() was implemented on top of
    times(2).  For improved precision, since glibc 2.18, it is
                      ^^^^^^^^^^^^^^^^^^
    implemented on top of clock_gettime(2) (using the
    CLOCK_PROCESS_CPUTIME_ID clock).

This looks strange. The user doesn't seek improved precision, but
improved accuracy: if one gets more digits but the value itself is
less accurate (i.e. the error against the ideal value is larger),
this is bad. Perhaps changing "precision" to "accuracy" would be
correct (I assume that the real goal of the change was not just
improved precision, but more importantly the resulting improved
accuracy). I've reported a bug about the glibc documentation:

  https://sourceware.org/bugzilla/show_bug.cgi?id=17383

Reported-by: Vincent Lefevre <vincent@vinc17.net>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
man3/clock.3

index 8cab01110fb210416307557b0f50b44574b7ab16..2a8609682e9ec934bd5c23fabfca5a6cd0ea63ef 100644 (file)
@@ -88,7 +88,7 @@ In glibc 2.17 and earlier,
 .BR clock ()
 was implemented on top of
 .BR times (2).
-For improved precision,
+For improved accuracy,
 since glibc 2.18, it is implemented on top of
 .BR clock_gettime (2)
 (using the