diff --git a/README.md b/README.md index e9dcb61..bee8ebc 100644 --- a/README.md +++ b/README.md @@ -48,15 +48,12 @@ bar := p.AddBar(100).PrependName("Single Bar:", 0, 0).AppendPercentage(5, 0) for i := 0; i < 100; i++ { + time.Sleep(time.Duration(rand.Intn(100)) * time.Millisecond) bar.Incr(1) // increment progress bar - time.Sleep(time.Duration(rand.Intn(100)) * time.Millisecond) } // Don't forget to stop mpb's rendering goroutine p.Stop() - - // You cannot add bars after p.Stop() has been called - // p.AddBar(100) // will panic ``` Running [this](example/singleBar/main.go), will produce: diff --git a/example_test.go b/example_test.go index b525c84..ecc2b2e 100644 --- a/example_test.go +++ b/example_test.go @@ -29,15 +29,12 @@ AppendPercentage(5, 0) for i := 0; i < 100; i++ { + time.Sleep(time.Duration(rand.Intn(100)) * time.Millisecond) bar.Incr(1) // increment progress bar - time.Sleep(time.Duration(rand.Intn(100)) * time.Millisecond) } // Don't forget to stop mpb's rendering goroutine p.Stop() - - // You cannot add bars after p.Stop() has been called - // p.AddBar(100) // will panic } func ExampleBar_InProgress() {