The execution profiler counts the number of times each predicate is called in execution. This profiler is helpful for identifying which portion of predicates are most frequently executed.
To gauge the execution of a program, follow the following steps:
- Compile the program with gauging calls and predicates inserted. To do so, either set the Prolog flag compiling to profilecode before compiling
?-set_prolog_flag(compiling,profilecode).
?-cl(filename).
or use profile_consult(filename) to load the source code.
- init_profile.
Initialize the counters.
- Execute a goal.
- profile.
Report the results.
Neng-Fa Zhou
2012-01-03