static void test(ForkJoinPool pool, int num) throws Exception { int ps = pool.getParallelism(); long start = System.nanoTime(); DynamicFib f = new DynamicFib(num); pool.invoke(f); long time = System.nanoTime() - start; double secs = ((double) time) / NPS; long result = f.number; System.out.print("DynamicFib " + num + " = " + result); System.out.printf("\tTime: %9.3f", secs); long sc = pool.getStealCount(); long ns = sc - lastStealCount; lastStealCount = sc; System.out.printf(" Steals: %4d", ns / ps); System.out.printf(" Workers: %4d", pool.getPoolSize()); System.out.println(); }