Skip to content

Commit

Permalink
changing date.now to performance.now
Browse files Browse the repository at this point in the history
  • Loading branch information
patnir committed Mar 21, 2024
1 parent d60cb4e commit f2e153a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ironfish-cli/src/utils/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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)

Expand All @@ -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()
}
}

Expand Down

0 comments on commit f2e153a

Please sign in to comment.