Skip to content

Commit

Permalink
Merge pull request #136 from howeyc/long-running
Browse files Browse the repository at this point in the history
Handle very-slow iterations
  • Loading branch information
schollz committed Sep 3, 2022
2 parents 405949e + d867d53 commit 9ee549e
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 9ee549e

Please sign in to comment.