#define U_TIME_H_
-#ifndef WIN32
+#include "pipe/p_config.h"
+
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
#include <time.h> /* timeval */
#include <unistd.h> /* usleep */
#endif
*/
struct util_time
{
-#ifndef WIN32
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
struct timeval tv;
#else
- long long counter;
+ int64_t counter;
#endif
};
int64_t usecs,
struct util_time *t2);
+uint64_t
+util_time_micros( void );
+
int64_t
util_time_diff(const struct util_time *t1,
const struct util_time *t2);
/**
- * Returns zero when the timeout expires, non zero otherwise.
+ * Returns non-zero when the timeout expires.
*/
-int
+boolean
util_time_timeout(const struct util_time *start,
const struct util_time *end,
const struct util_time *curr);
-#ifndef WIN32
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
#define util_time_sleep usleep
#else
-int
+void
util_time_sleep(unsigned usecs);
#endif