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

From: rainer_blome@de.ibm.com
Date: Tue Jun 20 2000 - 10:17:21 EST


Roscoe Bartlett wrote:
> ... 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. I need something much
> more accurate.

There was (is?) a series of articles about C performance in the C/C++ Users
Journal
by Koenig and Moo. One of the articles, in the February 2000 issue (+/- 2
months),
treated your question. The solution they used was to calibrate their own
delay
loop by watching exactly /when/ the value returned by clock() changes.
They were
able to increase accuracy by orders of magnitude this way.
However, as far as I recall, it didn't work on all platforms.
And it appears "from behind through the chest in the eye", as we say here.

Personally, I use the real time clock, use more iterations
and accept the inaccuracies.

Rainer

_________________________________________________________________________
Rainer Blome rainer_blome@de.ibm.com
Infrastructure & Systems Management IBM Deutschland
Informationssysteme GmbH
Tel.: 069-6645-1223 Adr.: Lyoner Str.13, 60582 Frankfurt/Main
Mobil: 0170-794 1303 Post: PF 710453, 60494
Frankfurt/Main

--------------------- 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