blob: 5c1f34e60d943bb074f0ada5747ac36cb4312763 [file] [log] [blame]
<script src="../resources/magnitude-perf.js"></script>
<script>
function setupFunction(magnitude)
{
array = [];
for (var i = 0; i < magnitude; i++) {
array[i] = i;
}
}
function test(magnitude)
{
array.push(1);
array.pop();
}
Magnitude.description("Tests that pushing and popping from an array is constant time.");
Magnitude.run(setupFunction, test, Magnitude.CONSTANT);
</script>