Codebase list golang-github-vbauerster-mpb / c62bf44
use default RR in examples Vladimir Bauer 9 years ago
2 changed file(s) with 5 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
1313
1414 func main() {
1515
16 p := mpb.New().RefreshRate(80 * time.Millisecond).SetWidth(64)
16 // p := mpb.New().RefreshRate(80 * time.Millisecond).SetWidth(64)
17 p := mpb.New().SetWidth(64)
1718
1819 name1 := "Bar#1:"
1920 bar1 := p.AddBar(50).AppendPercentage().PrependETA(4).PrependName(name1, len(name1))
5051 // p.RemoveBar(bar2)
5152
5253 p.WaitAndStop()
53 bar2.Incr(2)
5454 fmt.Println("stop")
5555 // p.AddBar(1) // panic: send on closed channnel
5656 }
1313
1414 func main() {
1515
16 p := mpb.New().RefreshRate(80 * time.Millisecond).SetWidth(64)
16 // p := mpb.New().RefreshRate(100 * time.Millisecond).SetWidth(64)
17 p := mpb.New().SetWidth(64)
1718
1819 name1 := "Bar#1:"
1920 bar1 := p.AddBar(50).AppendETA().PrependPercentage(3).PrependName(name1, len(name1))
3637 }
3738 }()
3839
39 name3 := "Bar#3:"
40 bar3 := p.AddBar(80).AppendETA().PrependPercentage(3).PrependName(name3, len(name3))
40 bar3 := p.AddBar(80).AppendETA().PrependPercentage(3).PrependName("Bar#3:", 0)
4141 go func() {
4242 blockSize := rand.Intn(maxBlockSize) + 1
4343 for i := 0; i < 80; i++ {
5151 // p.RemoveBar(bar2)
5252
5353 p.WaitAndStop()
54 bar2.Incr(2)
5554 fmt.Println("stop")
5655 // p.AddBar(1) // panic: send on closed channnel
5756 }