(b *testing.B)
| 116 | } |
| 117 | |
| 118 | func BenchmarkChildren(b *testing.B) { |
| 119 | var n int |
| 120 | |
| 121 | b.StopTimer() |
| 122 | sel := DocW().Find(".toclevel-2") |
| 123 | b.StartTimer() |
| 124 | for i := 0; i < b.N; i++ { |
| 125 | if n == 0 { |
| 126 | n = sel.Children().Length() |
| 127 | } else { |
| 128 | sel.Children() |
| 129 | } |
| 130 | } |
| 131 | if n != 2 { |
| 132 | b.Fatalf("want 2, got %d", n) |
| 133 | } |
| 134 | } |
| 135 | |
| 136 | func BenchmarkChildrenFiltered(b *testing.B) { |
| 137 | var n int |