Boost logo

Boost Users :

From: Ben Hutchings (ben.hutchings_at_[hidden])
Date: 2005-11-21 14:32:45


__PPS__ wrote:

>Will Bryant wrote:
>
>
>>__PPS__ wrote:
>>
>>
>>
>>>any ideas what's wrong, why clock() doesn't work anymore?
>>>
>>>
>>I'd hazard a guess that that's because it's measuring process CPU time
>>rather than wall clock time. If you replace the thing you're timing
>>with some solid computation, does clock() suddenly start giving the
>>results you expect?
>>
>>
>>
>
>
>If I understand right, what you say is that these delays are due to
>interaction with the os and they are not counted by clock (for this
>process)?
>
>
clock() is supposed to indicate how much time the processor has spent
running the process. It should exclude the time the process spends
waiting for input/output operations to complete, or waiting in the
runnable queue while other processes run.

(Unfortunately in the MS C library (and maybe other C libraries for
Windows) clock() indicates elapsed time since the process started,
perhaps for compatibility with its behaviour under DOS, where the active
process is never descheduled.)

Ben.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net