Skip to content

Commit

Permalink
fix: correct time calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
KazariEX committed Oct 9, 2024
1 parent ec8b850 commit 00f7919
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export function createPlainShiki(shiki: HighlighterCore) {
defaultTheme = "light",
selector = (theme) => `.${theme}`,
watch = true,
delay = 16.7
delay = 33.4
} = options;

const stylesheet = new CSSStyleSheet();
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function throttle<T extends unknown[]>(func: (...args: T) => void, delay:
clearTimeout(timer);
timer = void 0;
}
const now = performance.now() / 1000;
const now = performance.now();
if (!start || now - start >= delay) {
func.apply(this, args);
start = now;
Expand Down

0 comments on commit 00f7919

Please sign in to comment.