Skip to content

Instantly share code, notes, and snippets.

@polyglotpiglet
Created June 26, 2016 10:42
Show Gist options
  • Save polyglotpiglet/7eb3a300d313b4a2b5fbad25c1c38d15 to your computer and use it in GitHub Desktop.
Save polyglotpiglet/7eb3a300d313b4a2b5fbad25c1c38d15 to your computer and use it in GitHub Desktop.
public static void main(String... args) {
int count = 0;
for (int i =0; i <1000; i++) {
long startTime = System.nanoTime();
for (int j = 0; j < 1000; j ++) {
count += j;
}
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