Use performance.now instead of Date.now
This commit is contained in:
parent
7d6fde2dea
commit
907e85493f
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user