<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt">Thank you everyone. I measuring my program using time unix an I going to try to use the GHC profiling too.<br><div>&nbsp;</div>Tays Cristina do Amaral Pales Soares<div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Mensagem original ----<br>De: Cristian Perfumo &lt;cperfumo@gmail.com&gt;<br>Para: Seth Kurtzberg &lt;seth@cql.com&gt;<br>Cc: Tays Soares &lt;tayscristina@yahoo.com.br&gt;; glasgow-haskell-users@haskell.org<br>Enviadas: Terça-feira, 6 de Fevereiro de 2007 8:21:23<br>Assunto: Re: (no subject)<br><br>Hi Tays,<br>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).
<br>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.<br>Well, I don't know exactly if this answers your question. If it doesn't, my apologies.
<br>Cheers<br>Cristian<br><br><span style="font-family: courier new,monospace;">import System.Time</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">import Text.Printf
</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp; {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; ; timeStart &lt;- getClockTime</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; </span><span style="font-style: italic; font-family: courier new,monospace;">
... your process</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; </span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; ; timeEnd &lt;- getClockTime</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; ; let diff = (normalizeTimeDiff (diffClockTimes timeEnd timeStart))</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">
&nbsp;&nbsp;&nbsp; ; print ((((fromIntegral(tdPicosec diff))/(10^12))) + (fromIntegral((tdSec diff) + (60 * (tdMin diff)) + (3600 * (tdHour diff)))))</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; ; return ()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp; }</span><br><br><div><span class="gmail_quote">
On 2/6/07, <b class="gmail_sendername">Seth Kurtzberg</b> &lt;<a rel="nofollow" target="_blank" href="mailto:seth@cql.com">seth@cql.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
GHC has profiling support.<br><br>(By the way, many mail servers these days discard mail with no subject.)<br><br>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.
<br><br>Some probably have comparisons with imperative languages, and, even if they do not, the methodology should help you.<br><br>Seth Kurtzberg<br><br>On Mon, 5 Feb 2007 11:28:03 -0800 (PST)<br>Tays Soares &lt;<a rel="nofollow" target="_blank" href="mailto:tayscristina@yahoo.com.br">
tayscristina@yahoo.com.br</a>&gt; wrote:<br><br>&gt; Hello everyone,<br>&gt;<br>&gt; 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?
<br>&gt;<br>&gt; Thank you,<br>&gt; Tays<br>&gt;<br>&gt;<br>&gt;<br>&gt; __________________________________________________<br>&gt; Fale com seus amigos&nbsp;&nbsp;de graça com o novo Yahoo! Messenger<br>&gt; <a rel="nofollow" target="_blank" href="http://br.messenger.yahoo.com/">
http://br.messenger.yahoo.com/</a><br>_______________________________________________<br>Glasgow-haskell-users mailing list<br><a rel="nofollow" target="_blank" href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br><a rel="nofollow" target="_blank" href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users">
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br></blockquote></div><br>
</div><br></div></div><br>__________________________________________________<br>Fale com seus amigos  de graça com o novo Yahoo! Messenger <br>http://br.messenger.yahoo.com/ </body></html>