Skip to content

Instantly share code, notes, and snippets.

@erdbeerschnitzel
Created August 26, 2012 11:21
Show Gist options
  • Save erdbeerschnitzel/3477692 to your computer and use it in GitHub Desktop.
Save erdbeerschnitzel/3477692 to your computer and use it in GitHub Desktop.
Java GCF Performance Test
public class GGT {
public static void main(String[] args) {
for(int a = 0; a < 10; a++){
long creationDate = System.currentTimeMillis();
for(int i = 0; i < 100000; i++){
ggt(31232004,i);
}
System.out.println(System.currentTimeMillis() - creationDate);
}
}
public static int ggt(int zahl1, int zahl2) {
while (zahl2 != 0) {
if (zahl1 > zahl2) {
zahl1 = zahl1 - zahl2;
} else {
zahl2 = zahl2 - zahl1;
}
}
return zahl1;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment