Skip to content

Commit 9ee549e

Browse files
authored
Merge pull request #136 from howeyc/long-running
Handle very-slow iterations
2 parents 405949e + d867d53 commit 9ee549e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

progressbar.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,8 +747,10 @@ func renderProgressBar(c config, s *state) (int, error) {
747747
}
748748
if averageRate > 1 {
749749
bytesString += fmt.Sprintf("%0.0f %s/s", averageRate, c.iterationString)
750-
} else {
750+
} else if averageRate*60 > 1 {
751751
bytesString += fmt.Sprintf("%0.0f %s/min", 60*averageRate, c.iterationString)
752+
} else {
753+
bytesString += fmt.Sprintf("%0.0f %s/hr", 3600*averageRate, c.iterationString)
752754
}
753755
}
754756
if bytesString != "" {

0 commit comments

Comments
 (0)