From: Preston A. Elder (prez_at_[hidden])
Date: 2005-02-11 20:24:16
On Fri, 11 Feb 2005 20:12:08 -0500, christopher diggins wrote:
> Does "your task" here mean the current thread or does it mean the
> current process (or does it depend)?
> Thank you very much for the explanation. What advantage would
> wall-clock-time have for profiling tasks?
It would allow you to include how much time is spent sleeping or blocked
in your profiled time. Ordinarily, when a task goes to sleep or blocks
for any reason (disk I/O, waiting for a lock, etc) the kernel cuts short
the process/thread's timeslice, meaning std::clock() would not count
it, wall_clock would.
for (i=0; i<5; ++i)
$ time ./blah
As I said, I can see advantages for both - sometimes you want to know how
much of your time is in a specific area of code (including waiting for
stuff), and sometimes you want to know how expensive a piece of code (from
a CPU perspective) is.
-- PreZ :) Founder. The Neuromancy Society (http://www.neuromancy.net)
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk