MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / BenchmarkBinary

Function BenchmarkBinary

search/binary_test.go:56–62  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

54}
55
56func BenchmarkBinary(b *testing.B) {
57 testCase := generateBenchmarkTestCase()
58 b.ResetTimer() // this is important because the generateBenchmarkTestCase() is expensive
59 for i := 0; i < b.N; i++ {
60 _, _ = Binary(testCase, i, 0, len(testCase)-1)
61 }
62}
63
64func BenchmarkBinaryIterative(b *testing.B) {
65 testCase := generateBenchmarkTestCase()

Callers

nothing calls this directly

Calls 2

BinaryFunction · 0.85

Tested by

no test coverage detected