From 18c632c7540f28ed641931c3c0ca085a06e265fb 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 7bfbeb2..575b969 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 */ @@ -51886,7 +51886,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; }