
----- Original Message ----- From: "Preston A. Elder" <prez@neuromancy.net> To: <boost@lists.boost.org> Sent: Friday, February 11, 2005 6:05 PM Subject: [boost] Re: Re: Re: Profiling Library suggestion
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 time.
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.
I am confused. I don't see how measuring time intervals with either xtime_get() or QueryPerformanceCounter or std::clock() would differ apart from resolution and accuracy. CD