/*final List<FacetAccessible> list2 = new ArrayList<FacetAccessible>(numSegs);
for (int i=0;i<numSegs;++i){
list2.add(buildSubAccessible(fname2, 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(){
public void run() {
for (int i=0;i<numIters;++i){
long start = System.nanoTime();
final CombinedFacetAccessible combined1 = new CombinedFacetAccessible(fspec, list1);
// final CombinedFacetAccessible combined2 = new CombinedFacetAccessible(fspec, list2);
List<BrowseFacet> facets1 = combined1.getFacets();
//List<BrowseFacet> facets2 = combined2.getFacets();
long end= System.nanoTime();
timeCounter.getAndAdd(end-start);
}
}
});
}
// System.out.println("press key to start load test... ");
// {
// BufferedReader br = new BufferedReader(new InputStreamReader(
// System.in));
// int ch = br.read();
// char c = (char) ch;
// }
for (Thread t : threads){
t.start();
}
for (Thread t : threads){
t.join();
}
System.out.println("average time: "+timeCounter.get()/numIters/nThreads/1000000+" ms");
}