#include #include #include class Crun_time { public: Crun_time(const char* function_name="Unknown") { m_creation_time = boost::posix_time::microsec_clock::local_time(); } ~Crun_time() { std::cout << to_simple_string(boost::posix_time::microsec_clock::local_time() - m_creation_time) << std::endl; } private: boost::posix_time::ptime m_creation_time; };