Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
  • Loading branch information
mscdex committed Feb 8, 2017
commit 7bbe7216af9843bbca60db231e438490458554b8
6 changes: 3 additions & 3 deletions benchmark/_benchmark_progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ function fraction(numerator, denominator) {

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

Expand Down