From 26b09707f438fa1f848bc0b8526ace8d5c2eefdd Mon Sep 17 00:00:00 2001 From: Sami Vaarala Date: Fri, 4 Aug 2017 00:05:14 +0300 Subject: [PATCH] Use DUK_USE_GET_MONOTONIC_TIME when available --- src-input/duk_api_time.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src-input/duk_api_time.c b/src-input/duk_api_time.c index 481cfabd..498cf760 100644 --- a/src-input/duk_api_time.c +++ b/src-input/duk_api_time.c @@ -9,7 +9,11 @@ DUK_INTERNAL duk_double_t duk_time_get_ecmascript_time(duk_hthread *thr) { } DUK_INTERNAL duk_double_t duk_time_get_monotonic_time(duk_hthread *thr) { +#if defined(DUK_USE_GET_MONOTONIC_TIME) + return (duk_double_t) DUK_USE_GET_MONOTONIC_TIME(thr); +#else return (duk_double_t) DUK_USE_DATE_GET_NOW(thr); +#endif } DUK_EXTERNAL duk_double_t duk_get_now(duk_hthread *thr) {