summaryrefslogtreecommitdiff
path: root/deps/jemalloc/test/include/test/timer.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/jemalloc/test/include/test/timer.h')
-rw-r--r--deps/jemalloc/test/include/test/timer.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/deps/jemalloc/test/include/test/timer.h b/deps/jemalloc/test/include/test/timer.h
index ace6191b8..a7fefdfd1 100644
--- a/deps/jemalloc/test/include/test/timer.h
+++ b/deps/jemalloc/test/include/test/timer.h
@@ -1,8 +1,23 @@
/* Simple timer, for use in benchmark reporting. */
+#include <unistd.h>
+#include <sys/time.h>
+
+#define JEMALLOC_CLOCK_GETTIME defined(_POSIX_MONOTONIC_CLOCK) \
+ && _POSIX_MONOTONIC_CLOCK >= 0
+
typedef struct {
- nstime_t t0;
- nstime_t t1;
+#ifdef _WIN32
+ FILETIME ft0;
+ FILETIME ft1;
+#elif JEMALLOC_CLOCK_GETTIME
+ struct timespec ts0;
+ struct timespec ts1;
+ int clock_id;
+#else
+ struct timeval tv0;
+ struct timeval tv1;
+#endif
} timedelta_t;
void timer_start(timedelta_t *timer);