27 #ifndef _UCOMMON_TIMERS_H_
28 #define _UCOMMON_TIMERS_H_
30 #ifndef _UCOMMON_LINKED_H_
56 #if _POSIX_TIMERS > 0 && defined(POSIX_TIMERS)
59 #undef POSIX_TIMERS // make sure not used if no support
78 #if _MSC_VER > 1400 // windows broken dll linkage issue...
80 static const time_t reset = ((time_t)(0));
87 typedef unsigned __int64 tick_t;
89 typedef uint64_t tick_t;
107 Timer(time_t offset);
125 void set(time_t expire);
154 bool operator!()
const;
160 operator bool()
const;
166 Timer& operator=(time_t expire);
178 Timer& operator+=(time_t expire);
190 Timer& operator-=(time_t expire);
210 bool operator==(
const Timer& timer)
const;
217 bool operator!=(
const Timer& timer)
const;
224 bool operator<(
const Timer& timer)
const;
231 bool operator<=(
const Timer& timer)
const;
238 bool operator>(
const Timer& timer)
const;
245 bool operator>=(
const Timer& timer)
const;
251 static void sync(
Timer &timer);
257 static tick_t ticks(
void);
302 virtual void expired(
void) = 0;
345 {
return Timer::get();};
367 virtual void modify(
void) = 0;
374 virtual void update(
void) = 0;
423 __EXPORT
int gettimeofday(
struct timeval *tv,
void *tz);