(no subject)

Cristian Perfumo cperfumo at gmail.com
Tue Feb 6 05:21:23 EST 2007


Hi Tays,
If I understood correctly, if your compiler generates Haskell code, then
later on you should compile this code (with GHC, for example) and running it
implies a main function that is of the tipe IO() (i.e. IO Monad).
What you can do is to add (it could be, for example, in debugging mode in
your compiler) the code i paste below at the beginning and in the end of
your main function.
Well, I don't know exactly if this answers your question. If it doesn't, my
apologies.
Cheers
Cristian

import System.Time
import Text.Printf

   {
    ; timeStart <- getClockTime

    ... your process


    ; timeEnd <- getClockTime

    ; let diff = (normalizeTimeDiff (diffClockTimes timeEnd timeStart))

    ; print ((((fromIntegral(tdPicosec diff))/(10^12))) +
(fromIntegral((tdSec diff) + (60 * (tdMin diff)) + (3600 * (tdHour diff)))))

    ; return ()
    }

On 2/6/07, Seth Kurtzberg <seth at cql.com> wrote:
>
> GHC has profiling support.
>
> (By the way, many mail servers these days discard mail with no subject.)
>
> I've seen a number of papers comparing the speed of Haskell code to code
> of other functional languages; there is a periodic "shoot out" with ocaml.
>
> Some probably have comparisons with imperative languages, and, even if
> they do not, the methodology should help you.
>
> Seth Kurtzberg
>
> On Mon, 5 Feb 2007 11:28:03 -0800 (PST)
> Tays Soares <tayscristina at yahoo.com.br> wrote:
>
> > Hello everyone,
> >
> > I did at my master thesis a compiler that generates Haskell code. Now I
> need to measure the execution time of my generated code and I've been
> searched and I don't know if I'm looking with the wrong keywords but I could
> not find anything. I just need to measure the time of simple functions, like
> Ackermann and Fibonacci. Does anyone know how to measure the execution time
> of a Haskell program or function?
> >
> > Thank you,
> > Tays
> >
> >
> >
> > __________________________________________________
> > Fale com seus amigos  de graça com o novo Yahoo! Messenger
> > http://br.messenger.yahoo.com/
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20070206/74166e42/attachment-0001.htm


More information about the Glasgow-haskell-users mailing list