getrusage vs clock

Torbjörn Granlund tg at gmplib.org
Thu Jan 21 18:12:34 UTC 2016


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

  I don't know how to check which function is used. With gmp-6.1.0 on my
  workstation I get:
  
  zimmerma at tomate:/tmp/gmp-6.1.0/tune$ ./speed
  ...
  CPU cycle counter, supplemented by microsecond getrusage()
  Gnuplot home page http://www.gnuplot.info/
  Quickplot home page http://quickplot.sourceforge.net/
  
  which lets me think that getrusage() is still used.
  
How clever of you.  :-)
  
It seems that the logic of tune/time.c is not perfect.  In fact, there
are comments in that file about that the resolution detection for
getrusage is broken.

I expect that once we fix that, clock_gettime will automagically be
preferred.

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


More information about the gmp-devel mailing list