Skip to content

Instantly share code, notes, and snippets.

@dedunumax
Created November 20, 2013 16:52
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 dedunumax/7566642 to your computer and use it in GitHub Desktop.
Save dedunumax/7566642 to your computer and use it in GitHub Desktop.
public class Variable02 {
public static void main(String[] args) {
long startTime = System.nanoTime();
Method();
long endTime = System.nanoTime();
long duration = endTime - startTime;
System.out.println("Method runtime : " + duration + " ms");
}
public static void Method() {
String str;
for (int i = 0; i < 100000; i++) {
// Some Logic
str = Integer.toString(i);
System.out.println(str);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment