Created
November 16, 2016 21:13
-
-
Save mboes/24810d495490eefbfe4740c2187316ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.*; | |
import java.util.stream.*; | |
class A { | |
public static void main(String args[]) { | |
long start, finish; | |
start = System.nanoTime(); | |
//List<Integer> result = Stream.iterate(1, n -> n + 1) | |
//.limit(10000000) | |
long x = LongStream.range(0, 10000000000L) | |
.map(Math::incrementExact) | |
.sum(); | |
finish = System.nanoTime(); | |
System.out.println(x); | |
System.out.println((finish - start)/1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment