5 #ifndef __WVTIMEUTILS_H
6 #define __WVTIMEUTILS_H
11 int gettimeofday(
struct timeval *tv,
struct timezone *tz);
23 { tv_sec = long(t/1000000L); tv_usec = long(t%1000000L); }
24 WvTime(time_t sec, time_t usec)
25 { tv_sec = long(sec); tv_usec = long(usec); }
26 WvTime(
const struct timeval &tv)
27 { tv_sec = tv.tv_sec; tv_usec = tv.tv_usec; }
29 { tv_sec = tv.tv_sec; tv_usec = tv.tv_usec; }
31 operator long long()
const
32 {
return ((
long long)tv_sec)*1000000LL + tv_usec; }
35 static const WvTime wvtime_zero(0, 0);
57 inline void normalize(
WvTime &tv)
59 tv.tv_sec += tv.tv_usec < 0 ? (tv.tv_usec/1000000)-1 : tv.tv_usec/1000000;
60 tv.tv_usec %= 1000000;
61 tv.tv_usec += tv.tv_usec < 0 ? 1000000 : 0;
70 void wvstime_sync_forward();
74 void wvstime_set(
const WvTime &);
79 void wvdelay(
int msec_delay);
81 #endif // __WVTIMEUTILS_H