diff --git a/example_test.go b/example_test.go index c400098..2784fea 100644 --- a/example_test.go +++ b/example_test.go @@ -40,8 +40,8 @@ bar := p.AddBar(100).AppendPercentage(5, 0) for bar.InProgress() { + time.Sleep(time.Millisecond * 20) bar.Incr(1) - time.Sleep(time.Millisecond * 20) } } @@ -67,8 +67,8 @@ go func() { defer wg.Done() for i := 0; i < totalItem; i++ { + time.Sleep(time.Duration(rand.Intn(totalItem)) * time.Millisecond) bar.Incr(1) - time.Sleep(time.Duration(rand.Intn(totalItem)) * time.Millisecond) } }() } @@ -98,8 +98,8 @@ go func() { defer wg.Done() for i := 0; i < totalItem; i++ { + time.Sleep(time.Duration(rand.Intn(totalItem)) * time.Millisecond) bar.Incr(1) - time.Sleep(time.Duration(rand.Intn(totalItem)) * time.Millisecond) } }() }