<div>Consider the criterion package + the modifications you suggested. Criterion comes with useful functions for ensuring that you evaluate expressions correctly.</div><div><br></div><div>Ben</div><br><div class="gmail_quote">
On 16 April 2012 15:47, Dennis Raddle <span dir="ltr">&lt;<a href="mailto:dennis.raddle@gmail.com" target="_blank">dennis.raddle@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I want to profile a program, but it&#39;s not the usual kind of &quot;run once, it completes&quot; program. It computes a bunch of midi events and writes them to a MIDI port via the Sound.PortMidi module. It waits between events so that each one happens in the proper place in the music. And the program must not exit while it is writing events. <br>


<br>When I run it, it takes about ten seconds until the music starts, so it must be doing most of the computation then. But it takes several minutes as it plays music. <br><br>How would I profile this kind of program?<br>


<br>One possibility is to modify it a bit so it computes all the midi events but doesn&#39;t send them, and just exits. However, I have to make sure it actually computes the events all the way (due to language laziness). If I don&#39;t write the events to PortMidi, then they are never used. I&#39;m not sure on how to ensure an expression is completely evaluated if it never used.<span><font color="#888888"><br>


<br>Dennis<br>
</font></span><br>_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br>