12345678910111213141516171819202122232425 |
- package func_test
- import (
- "testing"
- )
- func BenchmarkFunc(t *testing.B) {
- t.StartTimer()
- for i := 0; i < 1000000000; {
- func() {
- i++
- }()
- }
- t.StopTimer()
- }
- func BenchmarkCode(t *testing.B) {
- t.StartTimer()
- for i := 0; i < 1000000000; {
- i++
- }
- t.StopTimer()
- }
|