Skip to content

Instantly share code, notes, and snippets.

@dvdsgl
Created May 16, 2010 20:38
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 dvdsgl/403149 to your computer and use it in GitHub Desktop.
Save dvdsgl/403149 to your computer and use it in GitHub Desktop.
[~/Developer/ScalaMono]% cat ScalaMono.scala
object ScalaMono extends Application {
def fib (i: Int): Int = i match {
case 0 | 1 => 1
case i => fib (i - 2) + fib (i - 1)
}
println (fib (35))
}
[~/Developer/ScalaMono]% time mono ScalaMono.exe
14930352
mono ScalaMono.exe 0.41s user 0.00s system 98% cpu 0.421 total
[~/Developer/ScalaMono]% time scala ScalaMono
14930352
scala ScalaMono 83.24s user 0.10s system 98% cpu 1:24.45 total
[~/Developer/ScalaMono]%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment