
On Sep 21, 2011, at 8:05 AM, Lars Viklund wrote:
On Wed, Sep 21, 2011 at 11:47:35AM +0100, Robert Jones wrote:
Hi All, #include
boost::progress_timer t; 0.00 s I was expecting a number >= 5.00 s! What am I missing?
According to the docs for progress_timer, it uses clock(). The man page for clock(3) on my system claims: * The clock() function returns an approximation of processor time used * by the program.
That doesn't seem to refer to wall time, so I would recommend you to file a bug against this library.
Yes, this is a well known problem with Boost.Timer. Imagine the fun you can have trying to time the speedup of a multicore program with such a timer. See http://boost.2283326.n4.nabble.com/system-Boost-Timer-replacement-tt3810315.... for Beman's proposed replacement. Vicente Botet is also working on a Stopwatches library based on Chrono for much the same purpose. Cheers, Gordon