Skip to content

Instantly share code, notes, and snippets.

@sumnulu
Created August 7, 2014 19:01
Show Gist options
  • Save sumnulu/cee4e66be2adab8a6a7b to your computer and use it in GitHub Desktop.
Save sumnulu/cee4e66be2adab8a6a7b to your computer and use it in GitHub Desktop.
kodcu.com Süre: 8274
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