mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-04-02 19:37:40 +03:00
26 lines
345 B
Go
26 lines
345 B
Go
package clashtcpip
|
|
|
|
import (
|
|
"crypto/rand"
|
|
"testing"
|
|
)
|
|
|
|
const (
|
|
chunkSize = 9000
|
|
chunkCount = 10
|
|
)
|
|
|
|
func Benchmark_SumCompat(b *testing.B) {
|
|
bytes := make([]byte, chunkSize)
|
|
|
|
_, err := rand.Reader.Read(bytes)
|
|
if err != nil {
|
|
b.Skipf("Rand read failed: %v", err)
|
|
}
|
|
|
|
b.ResetTimer()
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
SumCompat(bytes)
|
|
}
|
|
}
|