1 #ifndef MPQC_UTIL_TIMER_HPP
2 #define MPQC_UTIL_TIMER_HPP
5 #include <boost/date_time/posix_time/posix_time_types.hpp>
10 typedef boost::posix_time::time_duration value_type;
11 boost::posix_time::ptime start_;
12 typedef boost::posix_time::microsec_clock microsec_clock;
17 start_ = microsec_clock::universal_time();
19 boost::posix_time::time_duration duration()
const {
20 return microsec_clock::universal_time() - start_;
22 operator value_type()
const {
25 operator double()
const {
26 return duration().total_microseconds()/1e6;
28 long total_seconds()
const {
29 return duration().total_seconds();
41 #endif // MPQC_UTIL_TIMER_HPP