Revision control

1
<script src="../resources/magnitude-perf.js"></script>
2
<script>
3
function setupFunction(magnitude)
4
{
5
array = [];
6
for (var i = 0; i < magnitude; i++) {
7
array[i] = i;
8
}
9
}
10
11
function test(magnitude)
12
{
13
array.push(1);
14
array.pop();
15
}
16
17
Magnitude.description("Tests that pushing and popping from an array is constant time.");
18
Magnitude.run(setupFunction, test, Magnitude.CONSTANT);
19
</script>