Skip to content

Commit 48f6660

Browse files
mscdexitaloacasas
authored andcommitted
benchmark: fix timer display in progress output
This commit fixes an issue where the minutes would not display properly on the benchmark timer once an hour had elapsed. PR-URL: #11235 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Andreas Madsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 8ee236f commit 48f6660

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

benchmark/_benchmark_progress.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ function fraction(numerator, denominator) {
1515

1616
function getTime(diff) {
1717
const time = Math.ceil(diff[0] + diff[1] / 1e9);
18-
const seconds = pad(time % 60, 2, '0');
19-
const minutes = pad(Math.floor(time / 60) % (60 * 60), 2, '0');
20-
const hours = pad(Math.floor(time / (60 * 60)), 2, '0');
18+
const hours = pad(Math.floor(time / 3600), 2, '0');
19+
const minutes = pad(Math.floor((time % 3600) / 60), 2, '0');
20+
const seconds = pad((time % 3600) % 60, 2, '0');
2121
return `${hours}:${minutes}:${seconds}`;
2222
}
2323

0 commit comments

Comments
 (0)