// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
public class AA {
    private final static int REP = 20;
    private final static int N = 10000000;
    private static void test() {
        int[] a = new int[N];
        long t1 = System.currentTimeMillis();
        for(int i = 0; i < REP; i++) {
            for(int j = 0; j < N; j++) {
                a[j] = j;
            }
        }
        long t2 = System.currentTimeMillis();
        System.out.println((REP * N) + " array accesses in " + (t2 - t1) / 1000 + " seconds");
    }
    public static void main(String[] args) {
        test();
    }
}
