From f2e153aca754573456a399bed14dfdd07f566476 Mon Sep 17 00:00:00 2001 From: Rahul Patni Date: Thu, 21 Mar 2024 09:36:48 -0700 Subject: [PATCH] changing date.now to performance.now --- ironfish-cli/src/utils/transaction.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ironfish-cli/src/utils/transaction.ts b/ironfish-cli/src/utils/transaction.ts index e86bcd0425..2af15d4e26 100644 --- a/ironfish-cli/src/utils/transaction.ts +++ b/ironfish-cli/src/utils/transaction.ts @@ -50,7 +50,7 @@ export class TransactionTimer { format: '{title}: [{bar}] {percentage}% | {estimate}', }) as ProgressBar - this.startTime = Date.now() + this.startTime = performance.now() this.progressBar.start(100, 0, { title: 'Sending the transaction', @@ -61,7 +61,7 @@ export class TransactionTimer { if (!this.progressBar || !this.startTime) { return } - const durationInMs = Date.now() - this.startTime + const durationInMs = performance.now() - this.startTime const timeRemaining = this.estimateInMs - durationInMs const progress = Math.round((durationInMs / this.estimateInMs) * 100) @@ -79,7 +79,7 @@ export class TransactionTimer { clearInterval(this.timer) this.progressBar.update(100) this.progressBar.stop() - this.endTime = Date.now() + this.endTime = performance.now() } }