We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent da0caf5 commit cf0d2c8Copy full SHA for cf0d2c8
packages/vite/src/node/utils.ts
@@ -1501,11 +1501,17 @@ export function displayTime(time: number): string {
1501
return `${time.toFixed(2)}s`
1502
}
1503
1504
- const mins = parseInt((time / 60).toString())
1505
- const seconds = time % 60
+ // Calculate total minutes and remaining seconds
+ const mins = Math.floor(time / 60)
1506
+ const seconds = Math.round(time % 60)
1507
+
1508
+ // Handle case where seconds rounds to 60
1509
+ if (seconds === 60) {
1510
+ return `${mins + 1}m`
1511
+ }
1512
1513
// display: {X}m {Y}s
- return `${mins}m${seconds < 1 ? '' : ` ${seconds.toFixed(0)}s`}`
1514
+ return `${mins}m${seconds < 1 ? '' : ` ${seconds}s`}`
1515
1516
1517
/**
0 commit comments