From 5dd4154694d0a3cba3bc1490483aab2f557dd668 Mon Sep 17 00:00:00 2001 From: Jacob Roberts Date: Sat, 15 Nov 2025 07:51:04 +0000 Subject: [PATCH] Use performance now in tokenizeString instead of the raw Date.now() --- src/grammar/tokenizeString.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grammar/tokenizeString.ts b/src/grammar/tokenizeString.ts index 5524fdc4..7ed33998 100644 --- a/src/grammar/tokenizeString.ts +++ b/src/grammar/tokenizeString.ts @@ -58,10 +58,10 @@ class TokenizeStringResult { anchorPosition = whileCheckResult.anchorPosition; } - const startTime = Date.now(); + const startTime = performanceNow() while (!STOP) { if (timeLimit !== 0) { - const elapsedTime = Date.now() - startTime; + const elapsedTime = performanceNow() - startTime; if (elapsedTime > timeLimit) { return new TokenizeStringResult(stack, true); }