2018-10-31
作者:
学习者_310 | 来源:发表于
2023-04-24 17:52 被阅读0次ForkJoinPool pool = new ForkJoinPool(30);
final long begin = System.currentTimeMillis();
try {
pool.submit(() ->
numbers.parallelStream().map(k ->
{try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}return k;
}).collect(Collectors.toList())).get();
} catch (InterruptedException e) {
e.printStackTrace();
} catch (ExecutionException e) {
e.printStackTrace();
}
本文标题:2018-10-31
本文链接:https://www.haomeiwen.com/subject/mpcotqtx.html
网友评论