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 <[EMAIL PROTECTED]>
Para: Seth Kurtzberg <[EMAIL PROTECTED]>
Cc: Tays Soares <[EMAIL PROTECTED]>; glasgow-haskell-users@haskell.org
Enviadas: Terça-feira, 6 de Fevereiro de 2007 8:21:23
Assunto: Re: (no subject)

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 <[EMAIL PROTECTED]> 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 <
[EMAIL PROTECTED]> 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@haskell.org

http://www.haskell.org/mailman/listinfo/glasgow-haskell-users








__________________________________________________
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@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to