Переглянути джерело

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