Codebase list golang-github-vbauerster-mpb / 0263480
Add bench with name decorator Vladimir Bauer 8 years ago
1 changed file(s) with 10 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
22 import (
33 "io/ioutil"
44 "testing"
5
6 "github.com/vbauerster/mpb/decor"
57 )
68
79 func BenchmarkIncrSingleBar(b *testing.B) {
1921 bar.Increment()
2022 }
2123 }
24
25 func BenchmarkIncrSingleBarWithNameDecorator(b *testing.B) {
26 p := New(WithOutput(ioutil.Discard))
27 bar := p.AddBar(int64(b.N), PrependDecorators(decor.Name("test")))
28 for i := 0; i < b.N; i++ {
29 bar.Increment()
30 }
31 }