Boost logo

Boost :

From: Preston A. Elder (prez_at_[hidden])
Date: 2005-02-11 18:05:34

On Fri, 11 Feb 2005 17:41:16 -0500, Caleb Epstein wrote:

> One subtle difference is that the current implementation uses
> CPU-cycle timings (via std::clock or Win32 QueryPerformanceCounter)
> and not wall-clock timings. Using the xtime_get approach would give
> you a wall-clock based timer which may not be what you want.

I thought boost::timer (which the high_res_timer is modelled on) used wall
clock values though. This makes sense, because if you're using the timer
to say "X task to Y seconds", you hardly want to tell them how much CPU
time it spent on it. It would look odd to use a timer that told the user
X task took 20 seconds, when its been over a minute, it just got 20s CPU

This is basically something that needs to be decided, though I suppose
policies could take care of it (wall_clock or cpu_time for accumulation),
but do you want to profile how long it took something to run, or how much
time was spent doing it? As you say, they're subtly different things.

PreZ :)
Founder. The Neuromancy Society (

Boost list run by bdawes at, gregod at, cpdaniel at, john at