diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2017-09-24 02:47:07 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2017-09-24 02:47:07 (GMT) |
commit | e70dc43d6bfea81a565e3b420795bd351112458e (patch) | |
tree | 52ff1e3bee6e6d2481863c7367e69844f412d67c /src | |
parent | 6718b90009d537e15574f30c9ce4c40477b9d1ae (diff) | |
download | hdf5-e70dc43d6bfea81a565e3b420795bd351112458e.zip hdf5-e70dc43d6bfea81a565e3b420795bd351112458e.tar.gz hdf5-e70dc43d6bfea81a565e3b420795bd351112458e.tar.bz2 |
Update H5_now_usec to prefer using clock_gettime.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5timer.c | 9 |
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; |