MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

concurrent/Summing4.java:9–18  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

7
8public class Summing4 {
9 public static void main(String[] args) {
10 System.out.println(Summing3.CHECK);
11 Long[] aL = new Long[Summing3.SZ+1];
12 Arrays.parallelSetAll(aL, i -> (long)i);
13 Summing.timeTest("Long Parallel",
14 Summing3.CHECK, () ->
15 Arrays.stream(aL)
16 .parallel()
17 .reduce(0L,Long::sum));
18 }
19}
20/* Output:
2150000005000000

Callers

nothing calls this directly

Calls 3

timeTestMethod · 0.95
parallelSetAllMethod · 0.45
streamMethod · 0.45

Tested by

no test coverage detected