Boost logo

Boost :

From: Gennadiy E. Rozental (rogeeff_at_[hidden])
Date: 2001-11-01 03:20:16


> 2) On many systems, either the timer precision is so low or the
time
> latency is so high that it is impossible to use to measure the time
spent
> in a single function invocation, unless the function is a major
time
> burner. The only reliable way is to invoke the function a very
large
> number of times, and then divide the elapsed time by the number of
> invocations. This problem isn't unique to boost::timer, and is
probably
> getting much worse a clock speeds increase. How many modern
platforms can
> actually deliver timings with high enough precision and low enough
latency
> to accurately measure a single invocation of a smallish function?
>
> I'm inclined to think the solution may not be to try to fix timer,
but
> to specify a new timing library with much more precise semantics.
>
> --Beman

I think it would be a real chalange to write a portable
implementation for the function that for the given user function,
timer facility and user hint for how long the function should work
will calculate the real time the function work. It could need to
calculate somehow how many times it should run the the user function
for appropriate precision to be reached. Alsp effects of using timer
should be messured. It's like in theoretical phisics: mesuring tools
affect messured subject. I once read an articale with some solution -
do not remember where (I think in C++ Report).

Gennadiy.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk