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

Method main

concurrent/PizzaParallelSteps.java:11–25  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

9public class PizzaParallelSteps {
10 static final int QUANTITY = 5;
11 public static void main(String[] args) {
12 Timer timer = new Timer();
13 IntStream.range(0, QUANTITY)
14 .mapToObj(Pizza::new)
15 .parallel()
16 .map(Pizza::roll)
17 .map(Pizza::sauce)
18 .map(Pizza::cheese)
19 .map(Pizza::toppings)
20 .map(Pizza::bake)
21 .map(Pizza::slice)
22 .map(Pizza::box)
23 .forEach(za -> System.out.println(za));
24 System.out.println(timer.duration());
25 }
26}
27/* Output:
28Pizza 1: ROLLED

Callers

nothing calls this directly

Calls 2

durationMethod · 0.95
rangeMethod · 0.80

Tested by

no test coverage detected