From bac2e511c6dd2d717f6ff8a17bd82b9f293ba625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 15 Apr 2024 11:03:56 +0200 Subject: [PATCH] Fix performance.now() to return a double --- quickjs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quickjs.c b/quickjs.c index bb233911f..c7f54dce4 100644 --- a/quickjs.c +++ b/quickjs.c @@ -400,7 +400,7 @@ struct JSContext { JSValue global_obj; /* global object */ JSValue global_var_obj; /* contains the global let/const definitions */ - uint64_t time_origin; + double time_origin; uint64_t random_state; bf_context_t *bf_ctx; /* points to rt->bf_ctx, shared by all contexts */ @@ -51884,7 +51884,7 @@ void JS_AddIntrinsicTypedArrays(JSContext *ctx) /* Performance */ -static uint64_t js__now_ms(void) +static double js__now_ms(void) { return js__hrtime_ns() / 1e6; }