StartBlock is optional
Vladimir Bauer
8 years ago
| 55 | 55 |
// simulating some work
|
| 56 | 56 |
max := 100 * time.Millisecond
|
| 57 | 57 |
for i := 0; i < total; i++ {
|
| 58 | |
bar.StartBlock()
|
|
58 |
bar.StartBlock() // optional call, required for ETA
|
| 59 | 59 |
time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
|
| 60 | 60 |
// increment by 1 (there is bar.IncrBy(int) method, if needed)
|
| 61 | 61 |
bar.Increment()
|
| 36 | 36 |
// simulating some work
|
| 37 | 37 |
max := 100 * time.Millisecond
|
| 38 | 38 |
for i := 0; i < total; i++ {
|
| 39 | |
bar.StartBlock()
|
|
39 |
bar.StartBlock() // optional call, required for ETA
|
| 40 | 40 |
time.Sleep(time.Duration(rand.Intn(10)+1) * max / 10)
|
| 41 | 41 |
// Increment by 1 (there is bar.IncrBy(int) method, if needed)
|
| 42 | 42 |
bar.Increment()
|