Res: (no subject)
tayscristina at yahoo.com.br
Thu Feb 8 07:49:03 EST 2007
Thank you everyone. I measuring my program using time unix an I going to try to use the GHC profiling too.
Tays Cristina do Amaral Pales Soares
----- Mensagem original ----
De: Cristian Perfumo <cperfumo at gmail.com>
Para: Seth Kurtzberg <seth at cql.com>
Cc: Tays Soares <tayscristina at yahoo.com.br>; glasgow-haskell-users at haskell.org
Enviadas: Terça-feira, 6 de Fevereiro de 2007 8:21:23
Assunto: Re: (no subject)
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.
; 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.
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,
> Fale com seus amigos de graça com o novo Yahoo! Messenger
Glasgow-haskell-users mailing list
Glasgow-haskell-users at haskell.org
Fale com seus amigos de graça com o novo Yahoo! Messenger
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Glasgow-haskell-users