BenchmarkSprintf provides performance numbers for the fmt.Sprintf function.
(b *testing.B)
| 12 | // BenchmarkSprintf provides performance numbers for the |
| 13 | // fmt.Sprintf function. |
| 14 | func BenchmarkSprintf(b *testing.B) { |
| 15 | number := 10 |
| 16 | |
| 17 | b.ResetTimer() |
| 18 | |
| 19 | for i := 0; i < b.N; i++ { |
| 20 | fmt.Sprintf("%d", number) |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | // BenchmarkFormat provides performance numbers for the |
| 25 | // strconv.FormatInt function. |
nothing calls this directly
no outgoing calls
no test coverage detected