-
Notifications
You must be signed in to change notification settings - Fork 124
Closed
Description
package main
import (
"time"
"github.com/gosuri/uiprogress"
)
func main() {
uiprogress.Start() // start rendering
bar := uiprogress.AddBar(100) // Add a new bar
// optionally, append and prepend completion and elapsed time
bar.AppendCompleted()
bar.PrependElapsed()
for bar.Incr() {
time.Sleep(time.Millisecond * 1)
}
}
If you reduce sleep time (less than uiprogress.RefreshInterval), the progress bar will not reach 100%, see:
$ go run example/simple/simple.go
0 [=================================================================>--] 97%
I think there should have a mechanism to make sure the outputs are consistent. A Flush() method?
For example:
for bar.Incr() {
time.Sleep(time.Millisecond * 1)
}
uiprogress.Flush()
Metadata
Metadata
Assignees
Labels
No labels