Created
June 26, 2016 10:57
-
-
Save polyglotpiglet/fa6a20c9382f0ff27132c450fb9d8fc3 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) { | |
String curveBall = null; | |
int count = 0; | |
for (int i =0; i <1000; i++) { | |
long startTime = System.nanoTime(); | |
for (int j = 0; j < 1000; j ++) { | |
count += j; | |
if (curveBall != null) { | |
System.out.println(curveBall); | |
curveBall = null; | |
} | |
} | |
if (i == 600) curveBall = "Throwing a curve ball!!!!"; | |
long endtime = System.nanoTime(); | |
System.out.printf("%d\n", endtime - startTime); | |
} | |
System.out.println(count); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment