Go to the documentation of this file.
28#ifndef NETSURF_UTILS_SYS_TIME_H_
29#define NETSURF_UTILS_SYS_TIME_H_
34#define timerclear(a) ((a)->tv_sec = (a)->tv_usec = 0)
38#define timerisset(a) ((a)->tv_sec || (a)->tv_usec)
42#define timeradd(a, aa, result) \
44 (result)->tv_sec = (a)->tv_sec + (aa)->tv_sec; \
45 (result)->tv_usec = (a)->tv_usec + (aa)->tv_usec; \
46 if ((result)->tv_usec >= 1000000) { \
48 (result)->tv_usec -= 1000000; \
54#define timersub(a, aa, result) \
56 (result)->tv_sec = (a)->tv_sec - (aa)->tv_sec; \
57 (result)->tv_usec = (a)->tv_usec - (aa)->tv_usec; \
58 if ((result)->tv_usec < 0) { \
60 (result)->tv_usec += 1000000; \
66#define timercmp(a, aa, cmp) \
67 (((a)->tv_sec cmp (aa)->tv_sec) || \
68 ((a)->tv_sec == (aa)->tv_sec && (a)->tv_usec cmp (aa)->tv_usec))