26 #ifndef WFMATH_TIMESTAMP_H 27 #define WFMATH_TIMESTAMP_H 29 #include <wfmath/const.h> 37 #include <sys/timeb.h> 54 TimeDiff(
long sec,
long usec,
bool is_valid);
69 std::pair<long,long>
full_time()
const {
return std::make_pair(m_sec,m_usec);}
71 bool isValid()
const {
return m_isvalid;}
107 inline bool operator<=(
const TimeDiff &a,
const TimeDiff &b) {
return !(b < a);}
108 inline bool operator>=(
const TimeDiff &a,
const TimeDiff &b) {
return !(a < b);}
109 inline bool operator!=(
const TimeDiff &a,
const TimeDiff &b) {
return !(b == a);}
130 TimeStamp(
long sec,
long usec,
bool isvalid);
139 friend std::ostream& operator<<(std::ostream& os,
const TimeStamp&);
140 friend std::istream& operator>>(std::istream& is,
TimeStamp&);
142 bool isValid()
const {
return _isvalid;}
172 #endif // WFMATH_TIMESTAMP_H A time stamp.
Definition: timestamp.h:117
Generic library namespace.
Definition: atlasconv.h:45
friend TimeDiff & operator-=(TimeDiff &, const TimeDiff &)
decrement a TimeDiff
long milliseconds() const
Get the value of a TimeDiff in milliseconds.
TimeStamp()
Construct an uninitialized TimeStamp.
Definition: timestamp.h:133
TimeDiff()
construct an uninitialized TimeDiff
Definition: timestamp.h:57
TimeDiff operator-() const
negate a TimeDiff
Definition: timestamp.h:78
friend TimeDiff & operator+=(TimeDiff &, const TimeDiff &)
increment a TimeDiff
std::pair< long, long > full_time() const
Get the value of a TimeDiff in (seconds, microseconds)
Definition: timestamp.h:69
The difference between two timestamps.
Definition: timestamp.h:52
friend TimeDiff operator+(const TimeDiff &a, const TimeDiff &b)
add two TimeDiff instances