3 <div id="container" style="display: none;"></div>
4 <script src="../resources/magnitude-perf.js"></script>
7 var container = document.getElementById('container');
9 function setupFunction(magnitude)
11 container.innerHTML = '';
12 for (var i = 0; i < magnitude; i++)
13 container.appendChild(document.createElement('div'));
16 function test(magnitude)
18 container.children[0].class = 'first item';
19 container.children[container.children.length - 1].class = 'last item';
22 Magnitude.description("Tests that accessing the last item in children HTMLCollection is a constant time operation.");
23 Magnitude.run(setupFunction, test, Magnitude.CONSTANT);