use default RR in examples
Vladimir Bauer
9 years ago
| 13 | 13 |
|
| 14 | 14 |
func main() {
|
| 15 | 15 |
|
| 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)
|
| 17 | 18 |
|
| 18 | 19 |
name1 := "Bar#1:"
|
| 19 | 20 |
bar1 := p.AddBar(50).AppendPercentage().PrependETA(4).PrependName(name1, len(name1))
|
|
| 50 | 51 |
// p.RemoveBar(bar2)
|
| 51 | 52 |
|
| 52 | 53 |
p.WaitAndStop()
|
| 53 | |
bar2.Incr(2)
|
| 54 | 54 |
fmt.Println("stop")
|
| 55 | 55 |
// p.AddBar(1) // panic: send on closed channnel
|
| 56 | 56 |
}
|
| 13 | 13 |
|
| 14 | 14 |
func main() {
|
| 15 | 15 |
|
| 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)
|
| 17 | 18 |
|
| 18 | 19 |
name1 := "Bar#1:"
|
| 19 | 20 |
bar1 := p.AddBar(50).AppendETA().PrependPercentage(3).PrependName(name1, len(name1))
|
|
| 36 | 37 |
}
|
| 37 | 38 |
}()
|
| 38 | 39 |
|
| 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)
|
| 41 | 41 |
go func() {
|
| 42 | 42 |
blockSize := rand.Intn(maxBlockSize) + 1
|
| 43 | 43 |
for i := 0; i < 80; i++ {
|
|
| 51 | 51 |
// p.RemoveBar(bar2)
|
| 52 | 52 |
|
| 53 | 53 |
p.WaitAndStop()
|
| 54 | |
bar2.Incr(2)
|
| 55 | 54 |
fmt.Println("stop")
|
| 56 | 55 |
// p.AddBar(1) // panic: send on closed channnel
|
| 57 | 56 |
}
|