[Haskell-cafe] measuring time differences between functions
nrolle at web.de
Wed Jun 17 14:25:08 EDT 2009
I made parallel versions of my functions projection selection and sort
and i wanted to test the difference in runtime.
But he only printed 0.00 twice.
Maybe hes just too fast?
Or is it because of lazy evaluation?
or is there a better way to mesure performance in execution time?
main = do
xs <- readCSV "dataconvert/lineitem.tbl" '|'
start <- getCurrentTime
let pnp = projection  xs
let snp = selection (\x -> (x!!0) > (Int 17000)) pnp
let sortnp = sort  [ASC] snp
end <- getCurrentTime
putStrLn $ show (end `diffUTCTime` start)
start2 <- getCurrentTime
let pp = pProjection  xs
let sp = pSelection (\x -> (x!!0) > (Int 17000)) pp
let sortp = pSort  [ASC] sp
end2 <- getCurrentTime
putStrLn $ show (end2 `diffUTCTime` start2)
More information about the Haskell-Cafe