
This proposal suggests adding monotonic_time() static member function to the boost::date_time::microsec_clock and second_clock classes. usage example: #include <unistd.h> // for sleep() #include <iostream> #include <boost/date_time/posix_time/posix_time.hpp> #include "monotonic_time.hpp" int main() { namespace pt = boost::posix_time; typedef ext::microsec_clock<pt::ptime> usclock_t; // namespace ext instead of boost::date_time pt::ptime now = usclock_t::monotonic_time(); sleep(1); pt::ptime later = usclock_t::monotonic_time(); std::cout << later - now << std::endl; } Prototype implementation can be found in the attachment. If there is interest i am willing to finish the implementation and documentation. BR, Dmitry