Created
August 7, 2014 19:01
-
-
Save sumnulu/cee4e66be2adab8a6a7b to your computer and use it in GitHub Desktop.
kodcu.com Süre: 8274
This file contains hidden or 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 XintApp2 { | |
public static void main(String[] args) { | |
//optimizer'ı ısıtmak için | |
for (int j = 0; j < 4; j++) { | |
fun(); | |
} | |
long start = System.currentTimeMillis(); | |
for (int j = 0; j < 10; j++) { | |
fun(); | |
} | |
long end = System.currentTimeMillis(); | |
//System.out.println(buffer); | |
System.out.format("Süre: %d %n", (end - start)); | |
} | |
public static void fun(){ | |
//pre allocate memmory | |
StringBuffer buffer = new StringBuffer(Integer.MAX_VALUE / 5 + 100); | |
for (int i = 0; i < (Integer.MAX_VALUE / 50); i++) { | |
buffer.append("kodcu.com "); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment