blob: 8d3836020b4613aaabe2f2848bf1c90ee4e4e64c [file] [log] [blame]
package groovy.benchmarks
class Loop2 {
def array = new ArrayList()
def pos = 0
void push(obj){
array[pos] = obj
pos = pos + 1
}
Object pop(){
pos = pos - 1
return array[pos]
}
static void main(args){
println "Starting the Loop2 test"
def s = new Loop2()
for (i in 1..1000000){
s.push(i)
}
for (i in 1..1000000){
s.pop()
}
}
}