From a4eff5077e138d27411907addb9597d1da226be6 Mon Sep 17 00:00:00 2001 From: Zia Date: Thu, 14 Mar 2024 01:20:11 +0330 Subject: [PATCH] duplicated gettimeofday --- quickjs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/quickjs.c b/quickjs.c index c01e2ca..2a7f3e0 100644 --- a/quickjs.c +++ b/quickjs.c @@ -43243,11 +43243,10 @@ static uint64_t xorshift64star(uint64_t *pstate) return x * 0x2545F4914F6CDD1D; } +static int64_t date_now(void); static void js_random_init(JSContext *ctx) { - struct timeval tv; - gettimeofday(&tv, NULL); - ctx->random_state = ((int64_t)tv.tv_sec * 1000000) + tv.tv_usec; + ctx->random_state = date_now(); /* the state must be non zero */ if (ctx->random_state == 0) ctx->random_state = 1;