Skip to content

Instantly share code, notes, and snippets.

@conanak99
Created February 23, 2016 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save conanak99/2465130f5733ae355c26 to your computer and use it in GitHub Desktop.
Save conanak99/2465130f5733ae355c26 to your computer and use it in GitHub Desktop.
int total = 50000;
String s = "";
for (int i = 0; i < total; i++) { s += String.valueOf(i); }
// 4828ms
StringBuilder sb = new StringBuilder();
for (int i = 0; i < total; i++) { sb.append(String.valueOf(i)); }
// 4ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment