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.<br>
<br>Dennis<br>