blob: ee30b722023f228b54ace22c4ae63fad77b5cf46 [file] [log] [blame]
package groovy.benchmarks
class Loop {
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){
def s = new Loop()
for (i in 1..1000000){
s.push(i)
}
for (i in 1..1000000){
s.pop()
}
}
}