Re: getrusage vs clock

2016-01-21 Thread Niels Möller
t...@gmplib.org (Torbjörn Granlund) writes: > 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. Last time I looked, one had to run speed with -o cycles-broken to force using clock_gettime. Maybe it wo

Re: getrusage vs clock

2016-01-21 Thread Torbjörn Granlund
paul zimmermann writes: I don't know how to check which function is used. With gmp-6.1.0 on my workstation I get: zimmerma@tomate:/tmp/gmp-6.1.0/tune$ ./speed ... CPU cycle counter, supplemented by microsecond getrusage() Gnuplot home page http://www.gnuplot.info/ Quickplot home

Re: getrusage vs clock

2016-01-21 Thread paul zimmermann
> 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) direc

Re: getrusage vs clock

2016-01-21 Thread Torbjörn Granlund
paul zimmermann 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_ge