5.3. Time and allocation profiling

To generate a time and allocation profile, give one of the following RTS options to the compiled program when you run it (RTS options should be enclosed between +RTS...-RTS as usual):

-p or -P or -pa:

The -p option produces a standard time profile report. It is written into the file program.prof.

The -P option produces a more detailed report containing the actual time and allocation data as well. (Not used much.)

The -pa option produces the most detailed report containing all cost centres in addition to the actual time and allocation data.


Sets the interval that the RTS clock ticks at, which is also the sampling interval of the time and allocation profile. The default is 0.02 seconds.


This option causes the runtime to print out the current cost-centre stack whenever an exception is raised. This can be particularly useful for debugging the location of exceptions, such as the notorious Prelude.head: empty list error. See Section 4.17.7, “RTS options for hackers, debuggers, and over-interested souls”.