51 #elif defined (CPU) && CPU == PPC603 52 #include <sys/times.h> 59 #ifdef SNMP_PP_NAMESPACE 83 msec(
const msec &in_msec) : m_time(in_msec.m_time), m_changed(true) {};
91 msec(
const int sec,
const int milsec) : m_changed(true)
92 { m_time.tv_sec = sec; m_time.tv_usec = milsec; };
99 {
return((t1 < t2) || (t1 == t2)); };
101 {
return((t1 > t2) || (t1 == t2)); };
103 msec &operator-=(
const long millisec);
104 msec &operator-=(
const timeval &t1);
105 msec &operator+=(
const long millisec);
106 msec &operator+=(
const timeval &t1);
108 { m_time = t.
m_time; m_changed =
true;
return *
this; };
109 msec &operator=(
const timeval &t1);
116 operator unsigned long()
const 117 {
return ((m_time.tv_sec * 1000) + m_time.tv_usec); };
128 { m_time.tv_sec = (time_t) -1; m_time.tv_usec = 0; m_changed =
true; };
136 {
return ((m_time.tv_sec == (time_t) -1) && (m_time.tv_usec == 0)); };
145 void GetDelta(
const msec &future, timeval &timeout)
const;
160 const char *get_printable()
const;
167 #if !defined HAVE_LOCALTIME_R && !defined HAVE_REENTRANT_LOCALTIME 174 #ifdef SNMP_PP_NAMESPACE 178 #endif // _SNMP_MSEC_H_ DLLOPT friend int operator>=(const msec &t1, const msec &t2)
msec(const msec &in_msec)
Constructor using another msec object.
msec()
Constructor, sets the time to the current system time.
SNMP_PP_MUTABLE bool m_changed
void SetInfinite()
Set the object out into the future as far as possible.
void GetDelta(const msec &future, timeval &timeout) const
Get the difference between this and the given time.
static SnmpSynchronized m_localtime_mutex
msec(const int sec, const int milsec)
Constructor using seconds and milli sconds.
int IsInfinite() const
Check if the time is infinite.
DLLOPT friend int operator<=(const msec &t1, const msec &t2)
void GetDeltaFromNow(timeval &timeout) const
Get the difference between this object and the current system time.
msec & operator=(const msec &t)