Polish

parent 7717b4c8
......@@ -355,7 +355,6 @@ AC_CHECK_FUNCS([clock_gettime])
AC_CHECK_FUNCS([gethrtime])
LIBS="${save_LIBS}"
AC_DEFINE([USE_GETHRTIME], [1], [whether to use gethrtime])
if test "x$ac_cv_func_gethrtime" = xyes && \
test "x$ac_cv_func_clock_gettime" = xyes ; then
AC_MSG_CHECKING(if clock_gettime is faster than gethrtime)
......@@ -405,9 +404,9 @@ static hrtime_t cl()
return (1);
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([USE_GETHRTIME], [0], [whether to use gethrtime])
],
[AC_MSG_RESULT(no)
AC_DEFINE([USE_GETHRTIME], [1], [Define if gethrtime is preferred])
]
)
fi
......
......@@ -127,14 +127,14 @@ init(void)
double
VTIM_mono(void)
{
#if defined(HAVE_GETHRTIME) && USE_GETHRTIME
return (gethrtime() * 1e-9);
#elif HAVE_CLOCK_GETTIME
#if defined(HAVE_CLOCK_GETTIME) && !defined(USE_GETHRTIME)
struct timespec ts;
AZ(clock_gettime(CLOCK_MONOTONIC, &ts));
return (ts.tv_sec + 1e-9 * ts.tv_nsec);
#elif defined(__MACH__)
#elif defined(HAVE_GETHRTIME)
return (gethrtime() * 1e-9);
#elif defined(__MACH__)
uint64_t mt = mach_absolute_time() - mt_base;
return (mt * mt_scale);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment