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() }