Codebase list golang-github-vbauerster-mpb / 5f2931a
stress Completed Vladimir Bauer 8 years ago
1 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2525
2626 for i := 0; i < totalBars; i++ {
2727 name := fmt.Sprintf("Bar#%02d: ", i)
28 total := rand.Intn(120) + 10
28 total := rand.Intn(320) + 10
2929 startBlock := make(chan time.Time)
3030 bar := p.AddBar(int64(total),
3131 mpb.PrependDecorators(
4040 go func() {
4141 defer wg.Done()
4242 max := 100 * time.Millisecond
43 for i := 0; i < total; i++ {
43 for !bar.Completed() {
4444 startBlock <- time.Now()
4545 time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
4646 bar.Increment()