소스 검색

reset timer before benchmark

v2ray 9 년 전
부모
커밋
99a63f1633
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      common/crypto/benchmark_test.go

+ 1 - 0
common/crypto/benchmark_test.go

@@ -13,6 +13,7 @@ func benchmarkStream(b *testing.B, c cipher.Stream) {
 	b.SetBytes(benchSize)
 	input := make([]byte, benchSize)
 	output := make([]byte, benchSize)
+	b.ResetTimer()
 	for i := 0; i < b.N; i++ {
 		c.XORKeyStream(output, input)
 	}