Skip to content

Instantly share code, notes, and snippets.

@clowwindy
Created September 28, 2012 06:50
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 clowwindy/3798325 to your computer and use it in GitHub Desktop.
Save clowwindy/3798325 to your computer and use it in GitHub Desktop.
public class test {
public static int fib(int n) {
if (n < 2) {
return n;
} else {
return fib(n - 1) + fib(n - 2);
}
}
public static void main(String[] args) {
for(int i = 0; i < 99999999; i++) {
// System.out.print(fib(42) + "\n");
}
}
}
$ javac test.java
$ time java test
real 0m0.084s
user 0m0.092s
sys 0m0.015s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment