Created
August 26, 2012 11:21
-
-
Save erdbeerschnitzel/3477692 to your computer and use it in GitHub Desktop.
Java GCF Performance Test
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 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