Boost logo

Boost Users :

Subject: Re: [Boost-users] [Chrono]
From: Roland Bock (rbock_at_[hidden])
Date: 2010-04-14 14:30:29


Howard Hinnant wrote:
> On Apr 14, 2010, at 12:46 PM, Roland Bock wrote:
>
>
>> Hi,
>>
>> forgive me for asking the obvious, but I fail to see how to get timing
>> information from the thread_clock?
>>
>> I can call thread_clock::now() to get time_point objects, e.g.
>>
>> boost::chrono::thread_clock threadClock;
>>
>> boost::chrono::thread_clock::time_point start = threadClock.now();
>> [...]
>> boost::chrono::thread_clock::time_point end = threadClock.now();
>>
>>
>> But how do I get to the actual CPU milliseconds (or other units?) used
>> by the current thread between end and start?
>>
>
> You can use boost::duration_cast to convert the thread_clock::duration into whatever units you desire. This facility will round down (truncate) if an exact conversion is not possible. Ex:
>
[snip]

Great! Thanks for all the details!

Regards,

Roland



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