summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5timer.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/H5timer.c b/src/H5timer.c
index 2cb8cea..4a1f3f0 100644
--- a/src/H5timer.c
+++ b/src/H5timer.c
@@ -193,7 +193,14 @@ H5_now_usec(void)
{
uint64_t now; /* Current time, in microseconds */
-#ifdef H5_HAVE_GETTIMEOFDAY
+#if defined(H5_HAVE_CLOCK_GETTIME)
+ {
+ struct timespec ts;
+
+ HDclock_gettime(CLOCK_MONOTONIC, &ts);
+ now = (uint64_t)(ts.tv_sec * (1000 * 1000)) + (uint64_t)(ts.tv_nsec * 1000);
+ }
+#elif defined(H5_HAVE_GETTIMEOFDAY)
{
struct timeval now_tv;