Codebase list golang-github-vbauerster-mpb / 3d412cc
StartBlock is optional Vladimir Bauer 8 years ago
2 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
5555 // simulating some work
5656 max := 100 * time.Millisecond
5757 for i := 0; i < total; i++ {
58 bar.StartBlock()
58 bar.StartBlock() // optional call, required for ETA
5959 time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
6060 // increment by 1 (there is bar.IncrBy(int) method, if needed)
6161 bar.Increment()
3636 // simulating some work
3737 max := 100 * time.Millisecond
3838 for i := 0; i < total; i++ {
39 bar.StartBlock()
39 bar.StartBlock() // optional call, required for ETA
4040 time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
4141 // Increment by 1 (there is bar.IncrBy(int) method, if needed)
4242 bar.Increment()