OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <body> | |
3 <div id="container" style="display: none;"></div> | |
4 <script src="../resources/magnitude-perf.js"></script> | |
5 <script> | |
6 | |
7 var container = document.getElementById('container'); | |
8 | |
9 function setupFunction(magnitude) | |
10 { | |
11 container.innerHTML = ''; | |
12 for (var i = 0; i < magnitude; i++) | |
13 container.appendChild(document.createElement('div')); | |
14 } | |
15 | |
16 function test(magnitude) | |
17 { | |
18 container.children[0].class = 'first item'; | |
19 container.children[container.children.length - 1].class = 'last item'; | |
20 } | |
21 | |
22 Magnitude.description("Tests that accessing the last item in children HTMLCollec
tion is a constant time operation."); | |
23 Magnitude.numTrials = 5; | |
24 Magnitude.successThreshold = 0.40; // 2 out of 5 | |
25 Magnitude.tolerance = 0.40; | |
26 Magnitude.trim = 2; | |
27 Magnitude.run(setupFunction, test, Magnitude.CONSTANT); | |
28 | |
29 </script> | |
30 </body> | |
31 </html> | |
OLD | NEW |