Codebase list golang-github-vbauerster-mpb / ebae4a8
godoc example: bar.StartBlock() Vladimir Bauer 8 years ago
1 changed file(s) with 1 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3939 // simulating some work
4040 max := 100 * time.Millisecond
4141 for i := 0; i < total; i++ {
42 bar.StartBlock() // optional call, required for ETA
4243 time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
4344 // increment by 1 (there is bar.IncrBy(int) method, if needed)
4445 bar.Increment()