Haskell function execution time

See if http://hackage.haskell.org/package/timeit suits your needs.


Simplest things is to just do :set +s in ghci, and then you can see the execution time of anything you run, along with memory usage.


The criterion package was made specifically to do this well.


function execution time benchmark is included in Criterion.Measurement

for example, if I want to capture the time of someIOFunction :: IO ()

import Criterion.Measurement
main = secs <$> time_ someIOFunction >>= print

Tags:

Haskell