gallium/util: comments for time-related functions
[mesa.git] / src / gallium / auxiliary / util / u_time.h
index 7a5c54d9b235059dfee71c8a91464290959b0622..29fd1cbc67d5a69d19e43ad179ac110b8cbad35c 100644 (file)
 #include <unistd.h> /* usleep */
 #endif
 
+#if defined(PIPE_OS_HAIKU)
+#include <sys/time.h> /* timeval */
+#include <unistd.h>
+#endif
+
 #include "pipe/p_compiler.h"
 
 
@@ -58,7 +63,7 @@ extern "C" {
  */
 struct util_time 
 {
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
    struct timeval tv;
 #else
    int64_t counter;
@@ -69,14 +74,23 @@ struct util_time
 void 
 util_time_get(struct util_time *t);
 
+/**
+ * Return t2 = t1 + usecs
+ */
 void 
 util_time_add(const struct util_time *t1,
               int64_t usecs,
               struct util_time *t2);
 
+/**
+ * Return current time in microseconds
+ */
 uint64_t
 util_time_micros( void );
 
+/**
+ * Return difference between times, in microseconds
+ */
 int64_t
 util_time_diff(const struct util_time *t1, 
                const struct util_time *t2);
@@ -89,7 +103,7 @@ util_time_timeout(const struct util_time *start,
                   const struct util_time *end,
                   const struct util_time *curr);
 
-#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE)
+#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE) || defined(PIPE_OS_HAIKU)
 #define util_time_sleep usleep
 #else
 void