(String[] args)
| 10 | // SIZE reduced to make it run faster: |
| 11 | static final int SIZE = 5_000_000; |
| 12 | public static void main(String[] args) { |
| 13 | long[] la = new long[SIZE]; |
| 14 | Random r = new Random(); |
| 15 | System.out.println("parallelSetAll: " + |
| 16 | Timer.duration(() -> |
| 17 | Arrays.parallelSetAll(la, n -> r.nextLong()))); |
| 18 | System.out.println("setAll: " + |
| 19 | Timer.duration(() -> |
| 20 | Arrays.setAll(la, n -> r.nextLong()))); |
| 21 | SplittableRandom sr = new SplittableRandom(); |
| 22 | System.out.println("parallelSetAll: " + |
| 23 | Timer.duration(() -> |
| 24 | Arrays.parallelSetAll(la, n -> sr.nextLong()))); |
| 25 | System.out.println("setAll: " + |
| 26 | Timer.duration(() -> |
| 27 | Arrays.setAll(la, n -> sr.nextLong()))); |
| 28 | } |
| 29 | } |
| 30 | /* Output: |
| 31 | parallelSetAll: 1008 |
nothing calls this directly
no test coverage detected