117 |
|
} |
118 |
|
|
119 |
|
static void oneRun(Class<?> klass, int n, int items) throws Exception { |
120 |
< |
Deque<Integer> q = (Deque<Integer>) klass.newInstance(); |
120 |
> |
Deque<Integer> q = |
121 |
> |
(Deque<Integer>) klass.getConstructor().newInstance(); |
122 |
|
LoopHelpers.BarrierTimer timer = new LoopHelpers.BarrierTimer(); |
123 |
|
CyclicBarrier barrier = new CyclicBarrier(n + 1, timer); |
124 |
|
totalItems = new AtomicInteger(n * items); |
141 |
|
System.out.println(LoopHelpers.rightJustify(time / (items * n)) + " ns per item"); |
142 |
|
if (total == 0) // avoid overoptimization |
143 |
|
System.out.println("useless result: " + total); |
143 |
– |
|
144 |
|
} |
145 |
|
} |