Comply with rest examples
Vladimir Bauer
9 years ago
| 39 | 39 | bar := p.AddBar(100).AppendPercentage(5, 0) |
| 40 | 40 | |
| 41 | 41 | for bar.InProgress() { |
| 42 | time.Sleep(time.Millisecond * 20) | |
| 42 | 43 | bar.Incr(1) |
| 43 | time.Sleep(time.Millisecond * 20) | |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 66 | 66 | go func() { |
| 67 | 67 | defer wg.Done() |
| 68 | 68 | for i := 0; i < totalItem; i++ { |
| 69 | time.Sleep(time.Duration(rand.Intn(totalItem)) * time.Millisecond) | |
| 69 | 70 | bar.Incr(1) |
| 70 | time.Sleep(time.Duration(rand.Intn(totalItem)) * time.Millisecond) | |
| 71 | 71 | } |
| 72 | 72 | }() |
| 73 | 73 | } |
| 97 | 97 | go func() { |
| 98 | 98 | defer wg.Done() |
| 99 | 99 | for i := 0; i < totalItem; i++ { |
| 100 | time.Sleep(time.Duration(rand.Intn(totalItem)) * time.Millisecond) | |
| 100 | 101 | bar.Incr(1) |
| 101 | time.Sleep(time.Duration(rand.Intn(totalItem)) * time.Millisecond) | |
| 102 | 102 | } |
| 103 | 103 | }() |
| 104 | 104 | } |