9 #ifndef INCLUDE_FUNAPI_TIME_WALL_CLOCK_H_ 10 #define INCLUDE_FUNAPI_TIME_WALL_CLOCK_H_ 12 #include <boost/date_time/gregorian/greg_date.hpp> 13 #include <boost/date_time/posix_time/posix_time.hpp> 29 typedef boost::posix_time::ptime Value;
30 typedef boost::posix_time::time_duration Duration;
39 static bool Uninstall();
43 return boost::posix_time::seconds(sec);
48 return boost::posix_time::milliseconds(msec);
53 return boost::posix_time::microseconds(usec);
57 static WallClock::Value FromMonotonicClock(
62 const WallClock::Value &wall_clock);
65 static WallClock::Value Now();
68 static int64_t GetTimestampInSec();
71 static int64_t GetTimestampInSec(
const WallClock::Value &value);
74 static WallClock::Value FromTimestampInSec(int64_t timestamp_in_second);
77 static int64_t GetTimestampInMsec();
80 static int64_t GetTimestampInMsec(
const WallClock::Value &value);
83 static WallClock::Value FromTimestampInMsec(int64_t timestamp_in_msec);
86 static int64_t GetTimestampInUsec();
89 static int64_t GetTimestampInUsec(
const WallClock::Value &value);
92 static WallClock::Value FromTimestampInUsec(int64_t timestamp_in_usec);
95 static string GetTimestring();
98 static string GetTimestring(
const WallClock::Value &value);
100 static string GetLocalTimestring();
102 static string GetLocalTimestring(
const WallClock::Value &value);
105 static bool FromTimestring(
const string ×tring, WallClock::Value *value);
108 static WallClock::Value GetProcessStartTime();
111 static WallClock::Duration GetProcessUptime();
116 #endif // INCLUDE_FUNAPI_TIME_WALL_CLOCK_H_ Clock roughly representing wall clock.
Definition: wall_clock.h:27
ArgumentMap class manages application-specific run-time arguments.
Definition: argument_map.h:23
static Duration FromSec(int64_t sec)
Converts sec value into Duration.
Definition: wall_clock.h:42
static Duration FromUsec(int64_t usec)
Converts usec value into Duration.
Definition: wall_clock.h:52
Base class for any service in Funapi.
Definition: component.h:20
static Duration FromMsec(int64_t msec)
Converts msec value into Duration.
Definition: wall_clock.h:47
static const Duration kEmptyDuration
the value of 00:00:00.000000
Definition: wall_clock.h:36
static const Value kEpochClock
The value of time_t(0), 1970-01-01 00:00:00.000000 UTC.
Definition: wall_clock.h:33
int64_t Value
clock value in usec.
Definition: monotonic_clock.h:28