final List<FacetAccessible> list1 = new ArrayList<FacetAccessible>(numSegs);
for (int i = 0; i < numSegs; ++i) {
list1.add(buildSubAccessible(fname1, i, fspec));
}
final AtomicLong timeCounter = new AtomicLong();
Thread[] threads = new Thread[nThreads];
for (int i = 0; i < threads.length; ++i) {
threads[i] = new Thread(new Runnable() {
@Override
public void run() {
for (int i = 0; i < numIters; ++i) {
long start = System.nanoTime();
long end = System.nanoTime();
timeCounter.getAndAdd(end - start);
}
}
});
}
for (Thread t : threads) {
t.start();
}
for (Thread t : threads) {
t.join();
}
System.out
.println("average time: " + timeCounter.get() / numIters / nThreads / 1000000 + " ms");
}