OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <h1 id="id" class="class"></h1> | 4 <h1 id="id" class="class"></h1> |
5 <script src="../resources/runner.js"></script> | 5 <script src="../resources/runner.js"></script> |
6 <script> | 6 <script> |
7 PerfTestRunner.measureRunsPerSecond({ | 7 PerfTestRunner.measureRunsPerSecond({ |
8 description: "This benchmark tests querySelector() for an element that appea
rs near the head of the document", | 8 description: "This benchmark tests querySelectorAll() for an element that ap
pears near the head of the document", |
9 run: function() { | 9 run: function() { |
10 for (var i = 0; i < 1000; i++) { | 10 for (var i = 0; i < 1000; i++) { |
11 document.querySelector("h1"); | 11 document.querySelectorAll("h1"); |
12 document.querySelector("#id"); | 12 document.querySelectorAll("#id"); |
13 document.querySelector(".class"); | 13 document.querySelectorAll(".class"); |
14 } | 14 } |
15 }}); | 15 }}); |
16 </script> | 16 </script> |
17 </body> | 17 </body> |
18 </html> | 18 </html> |
OLD | NEW |