http://qiita.com/lovee/items/9701151633d61e7ed4e3 http://qiita.com/takustaqu/items/412d6c36534b1145a024
Because there was, it is a Java version.
int[] array = {5, 3, 6, 3, 6, 3, 1, 4, 7};
new ForkJoinPool(array.length).submit(() -> {
IntStream.of(array).parallel().forEach(n -> {
try {
TimeUnit.SECONDS.sleep(n);
System.out.println(n);
} catch (InterruptedException e) {
e.printStackTrace();
}
});
}).get();
/*output:
1
3
3
3
4
5
6
6
7
*/
Recommended Posts