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

Function BenchmarkBinaryIterative

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

Source from the content-addressed store, hash-verified

62}
63
64func BenchmarkBinaryIterative(b *testing.B) {
65 testCase := generateBenchmarkTestCase()
66 b.ResetTimer() // this is important because the generateBenchmarkTestCase() is expensive
67 for i := 0; i < b.N; i++ {
68 _, _ = BinaryIterative(testCase, i)
69 }
70}
71
72func BenchmarkLowerBound(b *testing.B) {
73 testCase := generateBenchmarkTestCase()

Callers

nothing calls this directly

Calls 2

BinaryIterativeFunction · 0.85

Tested by

no test coverage detected