(String[] args)
| 30 | } |
| 31 | } |
| 32 | public static void main(String[] args) { |
| 33 | Timer timer = new Timer(); |
| 34 | List<CompletableFuture<Pizza>> pizzas = |
| 35 | IntStream.range(0, QUANTITY) |
| 36 | .mapToObj(Pizza::new) |
| 37 | .map(CompletablePizza::makeCF) |
| 38 | .collect(Collectors.toList()); |
| 39 | System.out.println(timer.duration()); |
| 40 | pizzas.forEach(CompletablePizza::show); |
| 41 | System.out.println(timer.duration()); |
| 42 | } |
| 43 | } |
| 44 | /* Output: |
| 45 | 98 |