speculation/Benchmark.hs
2010-06-27 23:56:14 -07:00

15 lines
217 B
Haskell

module Main where
import Criterion.Main
fib :: Int -> Int
fib 0 = 0
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
main :: IO ()
main = defaultMain
[ bench "fib 1" $ nf fib 1
, bench "fib 2" $ nf fib 2
]