Boost logo

Boost Users :

From: Jonas Hansson (jonas_at_[hidden])
Date: 2007-12-12 03:14:42


On Tue, 11 Dec 2007 19:37:56 +0100, Simon Pickles <sipickles_at_[hidden]>
wrote:

boost::timer counts elapsed used CPU time. When sleep is "active" your
process does not use any CPU time, therefore it will not increase elapsed
time.
Try instead std::clock() or boost::xtime and compare start and end time if
you want real time used.

> Yes, sleep is in seconds. I can confirm that through direct
> experimentation :)
>
> Another forum helped and suggested I use gettimeofday. This works great,
> but doesn't shed any light on the zeros provided by boost::timer!
>
> Linux user #458601 - http://counter.li.org.
>
>
>
> Hughes, James wrote:
>>> -----Original Message-----
>>> From: boost-users-bounces_at_[hidden]
>>> [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Benoît Dagon
>>> Sent: 11 December 2007 16:25
>>> To: boost-users_at_[hidden]
>>> Subject: Re: [Boost-users] Boost::Timer problem
>>>
>>> Hi,
>>>
>>> boost::timer::elapsed() return a time in second. If you wait
>>> only 10 ms second you'll not see anything. Try with sleep(10000)...
>>>
>>> Cheers
>>> ~Benoît
>>>
>>
>> Isn't posix sleep a wait in seconds? usleep is sometimes available as
>> the microseconds function I believe.
>>
>> James

-- 
Jonas Hansson

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