22 #ifndef __M2ETIS_UTIL_REALTIMECLOCK_H__
23 #define __M2ETIS_UTIL_REALTIMECLOCK_H__
25 #include "boost/date_time/posix_time/posix_time.hpp"
26 #include "boost/function.hpp"
27 #include "boost/thread.hpp"
40 explicit RealTimeClock(
const boost::function<
void(
void)> & f);
61 const boost::posix_time::ptime startTime_;
63 boost::function<void(void)> update_;
65 volatile bool _running;
67 boost::thread thread_;
uint64_t getCurrentTime(uint64_t lastTime)
returns current time in microseconds
virtual ~RealTimeClock()
destructor
RealTimeClock(const boost::function< void(void)> &f)
initializes a worker thread calling given function when time changed
void Stop()
stops the clock
This Clock handles the real time.