Codebase list golang-github-vbauerster-mpb / c798548
WithWidth Vladimir Bauer 6 years ago
1 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
77 )
88
99 func BenchmarkIncrSingleBar(b *testing.B) {
10 p := New(WithOutput(ioutil.Discard))
10 p := New(WithOutput(ioutil.Discard), WithWidth(80))
1111 bar := p.AddBar(int64(b.N))
1212 for i := 0; i < b.N; i++ {
1313 bar.Increment()
1515 }
1616
1717 func BenchmarkIncrSingleBarWhileIsNotCompleted(b *testing.B) {
18 p := New(WithOutput(ioutil.Discard))
18 p := New(WithOutput(ioutil.Discard), WithWidth(80))
1919 bar := p.AddBar(int64(b.N))
2020 for !bar.Completed() {
2121 bar.Increment()
2323 }
2424
2525 func BenchmarkIncrSingleBarWithNameDecorator(b *testing.B) {
26 p := New(WithOutput(ioutil.Discard))
26 p := New(WithOutput(ioutil.Discard), WithWidth(80))
2727 bar := p.AddBar(int64(b.N), PrependDecorators(decor.Name("test")))
2828 for i := 0; i < b.N; i++ {
2929 bar.Increment()
3131 }
3232
3333 func BenchmarkIncrSingleBarWithNameAndEwmaETADecorator(b *testing.B) {
34 p := New(WithOutput(ioutil.Discard))
34 p := New(WithOutput(ioutil.Discard), WithWidth(80))
3535 bar := p.AddBar(int64(b.N),
3636 PrependDecorators(decor.Name("test")),
3737 AppendDecorators(decor.EwmaETA(decor.ET_STYLE_GO, 60)),