Boost logo

Boost Users :

Subject: Re: [Boost-users] A problem on using boost timer (different time intervals were showed). Can any one with kindness help me?
From: Rush Manbert (rush_at_[hidden])
Date: 2009-09-24 17:45:17


On Sep 24, 2009, at 1:20 PM, Chris Uzdavinis wrote:

> On Thu, Sep 24, 2009 at 4:08 PM, Dominique Devienne > Windows does
> support a high resolution timer, but I could never find a good impl
>> to re-use, and it's not portable of course. I wish Boost provided
>> such
>> a high res timer in a portable manner :) --DD
>
> Not sure if boost/posix_time is portable enough for you, but:
>
> #include "boost/date_time/posix_time/posix_time.hpp"
>
> void example() {
> boost::posix_time::ptime begin;
> boost::posix_time::ptime end;
>
> begin = boost::posix_time::microsec_clock::universal_time();
> do_something();
> end = boost::posix_time::microsec_clock::universal_time();
>
> std::cout << boost::posix_time::to_simple_string(end - begin);
> }
>

Sorry, but posix_time on Windows is only as good as the low res timer.
There's no help there.

- Rush



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