Re: OON: Timing function for GNU g++ ???

From: Bruno Haible (haible@ilog.fr)
Date: Mon Jun 19 2000 - 11:13:39 EST


Roscoe A. Bartlett writes:

> I was wondering if anyone knows of an accurate timing function to be used
> with Linux/GNU g++ 2.95.2? The standard library function clock() only
> appears to have a minimum resolution of 0.01 sec.

Try gettimeofday(), but be aware that it measures real time, not
process time. On x86, with glibc-2.1.90, you can also use the new
clock_gettime function, asking it for one of CLOCK_MONOTONIC,
CLOCK_PROCESS_CPUTIME_ID, CLOCK_THREAD_CPUTIME_ID.

Bruno

--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:13 EST