3 * Watt-32 time functions.
10 * The naming <sys/wtime.h> is required for those compilers that
11 * have <sys/time.h> in the usual place but doesn't define
18 #undef timezone /* a macro in bcc 5+ */
21 #ifndef __SYS_W32API_H
22 #include <sys/w32api.h>
26 #include <sys/cdefs.h>
29 #if defined(__DJGPP__)
31 #include <sys/times.h>
33 #elif defined(__MINGW32__)
41 #define STRUCT_TIMEVAL_DEFINED
44 #if !defined(__DJGPP__)
51 unsigned long tms_utime;
52 unsigned long tms_cstime;
53 unsigned long tms_cutime;
54 unsigned long tms_stime;
56 #define STRUCT_TIMEZONE_DEFINED
57 #define STRUCT_TMS_DEFINED
65 struct timeval it_interval; /* timer interval */
66 struct timeval it_value; /* current value */
69 W32_FUNC int getitimer (int, struct itimerval *);
70 W32_FUNC int setitimer (int, struct itimerval *, struct itimerval *);
72 W32_FUNC int gettimeofday (struct timeval *tp, struct timezone *tz);
76 #endif /* !__DJGPP__ */
78 #if !defined(_STRUCT_TIMESPEC) && !defined(_pthread_signal_h)
79 #define _STRUCT_TIMESPEC
92 W32_FUNC unsigned long net_times (struct tms *buffer);
93 W32_FUNC int gettimeofday2 (struct timeval *tv, struct timezone *tz);
98 * Operations on timevals.
100 * NB: timercmp does not work for >= or <=.
103 #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
105 #define timercmp(tvp, uvp, cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || \
106 ((tvp)->tv_sec == (uvp)->tv_sec && \
107 (tvp)->tv_usec cmp (uvp)->tv_usec))
109 #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
112 #endif /* !__SYS_WTIME_H */