All pastes #385894 Raw Edit

Stuff

public text v1 · immutable
·published 2007-03-08 04:24 UTC
rendered paste body
import java.util.*;

public class Foo {
public static void main(String[] args) {
  // LinkedList<Object> l = new LinkedList<Object>();
  ArrayList<Object> l = new ArrayList<Object>();
  for (int i = 0; i < 1000000; i++) {
    l.add(new Object());
  }

  int x = 0;
  long t1 = System.currentTimeMillis();
  for (int i = 0; i < 3; i++) {
    for (Object o : l) {
      x++;
    }
  }
  long t2 = System.currentTimeMillis();
  System.out.println(t2 - t1);

}
}