Hybrid Query Processing Engine for Coprocessing in Database Systems
HyPE
time_measurement.cpp
Go to the documentation of this file.
00001 
00002 #include <boost/chrono.hpp>
00003 #include <core/time_measurement.hpp>
00004 
00005 using namespace boost::chrono;
00006 
00007 namespace hype{
00008    namespace core{
00009 
00010    EstimatedTime::EstimatedTime() : value_in_nanoseconds_(-1){
00011 
00012    }
00013 
00014    EstimatedTime::EstimatedTime(double time_in_nanoseconds) : value_in_nanoseconds_(time_in_nanoseconds){
00015 
00016    }
00017 
00018    double EstimatedTime::getTimeinNanoseconds() const{
00019       return value_in_nanoseconds_;
00020    }
00021 
00022    MeasuredTime::MeasuredTime() : value_in_nanoseconds_(-1){
00023 
00024    }
00025 
00026    MeasuredTime::MeasuredTime(double time_in_nanoseconds) : value_in_nanoseconds_(time_in_nanoseconds){
00027 
00028    }
00029 
00030    double MeasuredTime::getTimeinNanoseconds() const{
00031       return value_in_nanoseconds_;
00032    }
00033 
00034    uint64_t getTimestamp()
00035    {
00036       high_resolution_clock::time_point tp = high_resolution_clock::now();
00037       nanoseconds dur = tp.time_since_epoch();
00038 
00039       return (uint64_t)dur.count();
00040    }
00041 
00042    }; //end namespace core
00043 }; //end namespace hype
00044 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines