Skip to content

Commit

Permalink
Handle very-slow iterations
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Sep 3, 2022
1 parent b055e61 commit d867d53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion progressbar.go
Expand Up @@ -747,8 +747,10 @@ func renderProgressBar(c config, s *state) (int, error) {
}
if averageRate > 1 {
bytesString += fmt.Sprintf("%0.0f %s/s", averageRate, c.iterationString)
} else {
} else if averageRate*60 > 1 {
bytesString += fmt.Sprintf("%0.0f %s/min", 60*averageRate, c.iterationString)
} else {
bytesString += fmt.Sprintf("%0.0f %s/hr", 3600*averageRate, c.iterationString)
}
}
if bytesString != "" {
Expand Down

0 comments on commit d867d53

Please sign in to comment.