getrusage vs clock

Torbjörn Granlund tg at gmplib.org
Thu Jan 21 11:47:58 UTC 2016


paul zimmermann <Paul.Zimmermann at inria.fr> writes:

  since version 2.18 of the glibc, the clock() function is much more precise.
  For example on my machine it has a resolution of 1 micro-seconds whereas
  getrusage() has a resolution of 4ms only, as demonstrated by the program
  below:
  
I believe we already use clock_gettime(2) directly on GNU/Linux, which
is the underlying syscall that clock(3) uses in newer GNU libc versions.

Does that not happen in your tests?

-- 
Torbjörn
Please encrypt, key id 0xC8601622


More information about the gmp-devel mailing list