Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

Use performance.now instead of Date.now

Koen Zweerts907e85493f9b
diff --git a/frontend/src/hooks/useThrottle.ts b/frontend/src/hooks/useThrottle.ts
index c9f4fcce..5e5352d9 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<number | null>(null);
React.useEffect(() => {
- const now = Date.now();
+ const now = performance.now();
if (!lastUpdated.current || now >= lastUpdated.current + interval) {
lastUpdated.current = now;