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

Function BenchmarkGet

math/matrix/matrix_test.go:205–214  ·  view source on GitHub ↗

BenchmarkGet benchmarks the Get method.

(b *testing.B)

Source from the content-addressed store, hash-verified

203
204// BenchmarkGet benchmarks the Get method.
205func BenchmarkGet(b *testing.B) {
206 // Create a sample matrix for benchmarking
207 rows := 100
208 columns := 100
209 matrix := matrix.New(rows, columns, 0)
210
211 for i := 0; i < b.N; i++ {
212 _, _ = matrix.Get(50, 50) // Change the row and column indices as needed
213 }
214}
215
216// BenchmarkSet benchmarks the Set method.
217func BenchmarkSet(b *testing.B) {

Callers

nothing calls this directly

Calls 2

NewFunction · 0.92
GetMethod · 0.65

Tested by

no test coverage detected