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&#39;t know exactly if this answers your question. If it doesn&#39;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 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&#39;ve seen a number of papers comparing the speed of Haskell code to code of other functional languages; there is a periodic &quot;shoot out&quot; 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 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&#39;ve been searched and I don&#39;t know if I&#39;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 href="http://br.messenger.yahoo.com/">
http://br.messenger.yahoo.com/</a><br>_______________________________________________<br>Glasgow-haskell-users mailing list<br><a href="mailto:Glasgow-haskell-users@haskell.org">Glasgow-haskell-users@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/glasgow-haskell-users">
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users</a><br></blockquote></div><br>