ã¡ãã£ã¨æ°ã«ãªã£ãã®ã§ãç°¡åã«ãã³ããã¼ã¯ãã¦ã¿ã¾ããã æåã¯ãã©ã ãå¼ã³åºããå ¥ãåforEachã¯é ãããããªããã¨æã£ã¦ããããåã®éãã«ã ãã¡ãããããããªæ¡ä»¶ã§å¤ãããã ãããã©ãããã¾ã§å·®ãåºããã¨ãããã®ã¯é©ãã ãã¨ãCollectors.summingIntã®ãããªåºæ¬åã«å¯¾ããCollectorã使ãããã¯ãintStreamã«å¤æãã¦ããsumãªã©å°ç¨ã¡ã½ããã使ãã»ããå§åçã«éããã¨ã確èªã§ããã ã¨ããããã0ãã10ä¸ä»¶ã®Listãç¨æã array = IntStream.range(0, 100_000).boxed().collect(Collectors.toList()); ãããããã³ããã¼ã¯ç¨ã®ã¡ã½ãããç¨æã public static void bench(String name, Supplier<Integer> proc){ ben
{{#tags}}- {{label}}
{{/tags}}