Skip to content

Instantly share code, notes, and snippets.

@conanak99

conanak99/example.java Secret

Created Feb 23, 2016
Embed
What would you like to do?
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