00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <boost/date_time.hpp>
00019 #include <drizzled/common_fwd.h>
00020
00021 namespace drizzled {
00022 namespace session {
00023
00024 class DRIZZLED_API Times
00025 {
00026 public:
00027 Times() :
00028 _epoch(boost::gregorian::date(1970, 1 ,1))
00029 {
00030 _connect_time = boost::posix_time::microsec_clock::universal_time();
00031 utime_after_lock = 0;
00032 }
00033
00034 uint64_t getConnectMicroseconds() const;
00035 uint64_t getConnectSeconds() const;
00036 void resetUserTime();
00037 void set_time();
00038 void set_time(time_t);
00039 void set_time_after_lock();
00040 void set_end_timer(Session&);
00041 uint64_t getElapsedTime() const;
00042 type::epoch_t getCurrentTimestamp(bool actual= true) const;
00043 type::epoch_t getCurrentTimestampEpoch() const;
00044 type::epoch_t getCurrentTimestampEpoch(type::usec_t& fraction_arg) const;
00045 type::epoch_t query_start();
00046 boost::posix_time::ptime start_timer() const;
00047 boost::posix_time::ptime epoch() const;
00048
00049 boost::posix_time::ptime _epoch;
00050 boost::posix_time::ptime _connect_time;
00051 boost::posix_time::ptime _end_timer;
00052 boost::posix_time::ptime _user_time;
00053 boost::posix_time::ptime _start_timer;
00054 uint64_t utime_after_lock;
00055 };
00056
00057 }
00058 }