Haskell API for memory useage

Neil Mitchell ndmitchell at gmail.com
Sat Mar 10 09:42:32 EST 2007


Hi Donald,

> This stuff is surprisingly tricky for some reason. Have a look at the
> gtop (C?) lib (there's also a perl binding used for the shootout).
>
> I'm not sure why shells in general don't provide a 'memory' combinator,
> considering we have 'time'.

I don't want to do this in the shell, but if I did "-RTS -t" already
dumps it to a file and I can get the answer from there.

The example I want is:

do
     x <- getCPUTime
     compute
     y <- getCPUTime
     z <- getMemoryUse
     print "Your computation took {y-x}ms and {z}kb"

Thanks

Neil


More information about the Glasgow-haskell-users mailing list