Last active
June 26, 2016 12:13
-
-
Save polyglotpiglet/12aad23902e9a24aeb93ddda0ac62967 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
public static void main(String... args) throws IOException { | |
Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File("/Users/alexbate/out.txt")))); | |
int count = 0; | |
for (int i =0; i <2000; i++) { | |
long startTime = System.nanoTime(); | |
for (int j = 0; j < 1000; j ++) { | |
count += j; | |
} | |
long endTime = System.nanoTime(); | |
writer.write("" + (endTime - startTime) + "\n"); | |
System.out.println(i); | |
} | |
writer.close(); | |
System.out.println(count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment