put Start/StopTimer() at right place

This commit is contained in:
iamqizhao
2015-04-29 11:20:15 -07:00
parent dfda1a1061
commit 58e0450a3c

View File

@ -44,11 +44,11 @@ func run(b *testing.B, maxConcurrentCalls int, caller func(testpb.TestServiceCli
wg.Done() wg.Done()
}() }()
} }
for i := 0; i < b.N; i++ {
b.StartTimer() b.StartTimer()
for i := 0; i < b.N; i++ {
ch <- i ch <- i
b.StopTimer()
} }
b.StopTimer()
close(ch) close(ch)
wg.Wait() wg.Wait()
conn.Close() conn.Close()