MCPcopy Create free account
hub / github.com/PuerkitoBio/goquery / BenchmarkIndex

Function BenchmarkIndex

bench_array_test.go:64–76  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

62}
63
64func BenchmarkIndex(b *testing.B) {
65 var j int
66
67 b.StopTimer()
68 sel := DocB().Find("#Main")
69 b.StartTimer()
70 for i := 0; i < b.N; i++ {
71 j = sel.Index()
72 }
73 if j != 3 {
74 b.Fatalf("want 3, got %d", j)
75 }
76}
77
78func BenchmarkIndexSelector(b *testing.B) {
79 var j int

Callers

nothing calls this directly

Calls 3

DocBFunction · 0.85
FindMethod · 0.80
IndexMethod · 0.80

Tested by

no test coverage detected