23 Jul
2008
23 Jul
'08
4:11 p.m.
// untested!! namespace pt = boost::posix_time; pt::ptime now1 = pt::microsec_clock::universal_time(); ///....do something here... pt::ptime now2 = pt::microsec_clock::universal_time(); pt::time_duration dur = now2 - now1; you can get then dur.total_milliseconds();
I've been struggling with how to use the Date_Time library to measure time elapsed (like to measure how long code takes to execute).
Could somebody provide me with an example? Resolution should be around msec. I could not find any in the reference that particularly addresses this.