Procházet zdrojové kódy

reset timer before benchmark

v2ray před 9 roky
rodič
revize
99a63f1633
1 změnil soubory, kde provedl 1 přidání a 0 odebrání
  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)
 	}