benchmarks: readability and bugfixes

This commit is contained in:
glebarez
2022-01-11 15:17:31 +01:00
parent 884a3ed642
commit f6f0331b65
5 changed files with 88 additions and 69 deletions

View File

@@ -9,15 +9,7 @@ import (
"testing"
)
func test_pronounceNum(t *testing.T) {
// this is only for visual testing
for i := 0; i < 10; i++ {
n := rand.Int31()
t.Logf("%d: %s\n", n, pronounceNum(uint32(n)))
}
}
func Benchmark_pronounceNum(b *testing.B) {
func BenchmarkPronounceNum(b *testing.B) {
for i := 0; i < b.N; i++ {
n := rand.Int31()
pronounceNum(uint32(n))