mirror of https://github.com/v2ray/v2ray-core
reset timer before benchmark
parent
99821dc2fb
commit
99a63f1633
|
@ -13,6 +13,7 @@ func benchmarkStream(b *testing.B, c cipher.Stream) {
|
||||||
b.SetBytes(benchSize)
|
b.SetBytes(benchSize)
|
||||||
input := make([]byte, benchSize)
|
input := make([]byte, benchSize)
|
||||||
output := make([]byte, benchSize)
|
output := make([]byte, benchSize)
|
||||||
|
b.ResetTimer()
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
||||||
c.XORKeyStream(output, input)
|
c.XORKeyStream(output, input)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue