24 Sep
2009
24 Sep
'09
8:20 p.m.
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); } Chris