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