Skip to content

Commit 55167c8

Browse files
committed
date.now -> performance.now
1 parent 3215ea5 commit 55167c8

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

web/src/lib/diff-viewer-multi-file.svelte.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,17 +505,18 @@ export class MultiFileDiffViewerState {
505505

506506
// Load patches
507507
const tempDetails: FileDetails[] = [];
508-
let lastYield = Date.now();
508+
let lastYield = performance.now();
509509
for await (const details of generator) {
510510
this.loadingState.loadedCount++;
511511

512512
// Pushing directly to the main array causes too many signals to update (lag)
513513
tempDetails.push(details);
514514

515-
if (Date.now() - lastYield > 50) {
515+
const now = performance.now();
516+
if (now - lastYield > 50) {
516517
await tick();
517518
await animationFramePromise();
518-
lastYield = Date.now();
519+
lastYield = now;
519520
}
520521
}
521522
if (tempDetails.length === 0) {

0 commit comments

Comments
 (0)