We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CleanOnFinish
package main import ( "sync" "time" "github.com/cheggaaa/pb/v3" ) func main() { count := 5 var wg sync.WaitGroup wg.Add(count) // pool requires atleast one bar to start root := pb.New(count) pool := pb.NewPool(root) _ = pool.Start() for i := 0; i < count; i++ { go func() { defer func() { root.Increment() defer wg.Done() }() bar := pb.StartNew(1000) bar.Set(pb.CleanOnFinish, true) pool.Add(bar) for i := 0; i < 1000; i++ { time.Sleep(time.Millisecond) bar.Increment() } bar.Finish() }() } wg.Wait() pool.Stop() }
Got:
5 / 5 [-------------------------------------------------------------------->] 100.00% ? p/s 1000 / 1000 [------------------------------------------------------------] 100.00% 1076 p/s 1000 / 1000 [------------------------------------------------------------] 100.00% 1076 p/s 1000 / 1000 [------------------------------------------------------------] 100.00% 1076 p/s 1000 / 1000 [------------------------------------------------------------] 100.00% 1076 p/s 1000 / 1000 [------------------------------------------------------------] 100.00% 1076 p/s
Expected:
5 / 5 [-------------------------------------------------------------------->] 100.00% ? p/s
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Got:
Expected:
The text was updated successfully, but these errors were encountered: