Merge pull request #34 from jserv/use-clock_gettime

Use clock_gettime() instead of timespec_get()
This commit is contained in:
Daan 2019-06-24 17:48:46 -07:00 committed by GitHub
commit 460ac23307
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -312,10 +312,10 @@ static double mi_clock_now() {
}
#else
#include <time.h>
#ifdef TIME_UTC
#ifdef CLOCK_REALTIME
static double mi_clock_now() {
struct timespec t;
timespec_get(&t, TIME_UTC);
clock_gettime(CLOCK_REALTIME, &t);
return (double)t.tv_sec + (1.0e-9 * (double)t.tv_nsec);
}
#else