[project @ 2000-04-25 11:27:35 by rrt]
[ghc-hetmet.git] / ghc / tests / io / should_run / io012.hs
1 -- !!! Test getCPUTime
2
3 import IO
4
5 import CPUTime
6
7 main = do
8     print (nfib 30)
9     t <- getCPUTime
10     print (length (show t)) -- printing the CPU time itself is un-cool if you want to diff the output..
11
12 nfib :: Integer -> Integer
13 nfib n 
14   | n <= 1 = 1
15   | otherwise = (n1 + n2 + 1)
16   where 
17     n1 = nfib (n-1) 
18     n2 = nfib (n-2)