private void sumFromMultipleThreads() {
        SumUpdater updater = new SumUpdater();
        ThreadLocalDirectory<Integer, Integer> s = new ThreadLocalDirectory<Integer, Integer>(updater);
        Thread[] threads = new Thread[500];
        for (int i = 0; i < 500; ++i) {
            Counter c = new Counter(s);
            threads[i] = new Thread(c);
        }
        runAll(threads);
        List<Integer> measurements = s.fetch();
        long sum = 0;
        for (Integer i : measurements) {
            sum += i.intValue();
        }
        System.out.println("Sum from all threads: " + sum);
    }
This just bangs on a shared to give some sort of lower bound for time
elapsed.
vespajlib/developernotes/ThreadLocalDirectoryBenchmark.java