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()
}()
}
b.StartTimer()
for i := 0; i < b.N; i++ {
b.StartTimer()
ch <- i
b.StopTimer()
}
b.StopTimer()
close(ch)
wg.Wait()
conn.Close()