From 907e85493f9b913683e0a9069aff32d3a2624763 Mon Sep 17 00:00:00 2001 From: Koen Zweerts Date: Thu, 16 Nov 2023 11:11:48 +0100 Subject: [PATCH] Use performance.now instead of Date.now --- frontend/src/hooks/useThrottle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/hooks/useThrottle.ts b/frontend/src/hooks/useThrottle.ts index c9f4fcc..5e5352d 100644 --- a/frontend/src/hooks/useThrottle.ts +++ b/frontend/src/hooks/useThrottle.ts @@ -8,7 +8,7 @@ export function useThrottle(value: string, interval = 500) { const lastUpdated = React.useRef(null); React.useEffect(() => { - const now = Date.now(); + const now = performance.now(); if (!lastUpdated.current || now >= lastUpdated.current + interval) { lastUpdated.current = now;