Przeglądaj źródła

reset timer before benchmark

v2ray 9 lat temu
rodzic
commit
99a63f1633
1 zmienionych plików z 1 dodań i 0 usunięć
  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)
 	}