Did you know ... Search Documentation:
statistics.pl -- Get information about resource usage
PublicShow source

This library provides predicates to obtain information about resource usage by your program. The predicates of this library are for human use at the toplevel: information is printed. All predicates obtain their information using public low-level primitives. These primitives can be use to obtain selective statistics during execution.

Source statistics is det
Print information about resource usage using print_message/2.
See also
- All statistics printed are obtained through statistics/2.
Source statistics(-Stats:dict) is det
Stats is a dict representing the same information as statistics/0. This convience function is primarily intended to pass statistical information to e.g., a web client. Time critical code that wishes to collect statistics typically only need a small subset and should use statistics/2 to obtain exactly the data they need.
Source thread_statistics(?Thread, -Stats:dict) is nondet
Obtain statistical information about a single thread. Fails silently of the Thread is no longer alive.
Stats- is a dict containing status, time and stack-size information about Thread.
Source time(:Goal) is nondet
Execute Goal, reporting statistics to the user. If Goal succeeds non-deterministically, retrying reports the statistics for providing the next answer.

Statistics are retrieved using thread_statistics/3 on the calling thread. Note that not all systems support thread-specific CPU time. Notable, this is lacking on MacOS X.

See also
- statistics/2 for obtaining statistics in your program and understanding the reported values.
- Inference statistics are often a few off.
Source profile(:Goal)
Source profile(:Goal, +Options)
Run Goal under the execution profiler. Defined options are:
Profile cpu or wall time. The default is CPU time.
When generating a textual report, show the top N predicates.
If true (default false), show cumulative output in a textual report.
Source show_profile(+Options)
Display last collected profiling data. Options are
When generating a textual report, show the top N predicates.
If true (default false), show cumulative output in a textual report.
Source prof_statistics(-Node) is det[private]
Get overall statistics
Node- term of the format prof(Ticks, Account, Time, Nodes)
Source prof_node(+Field, -Pairs) is nondet[private]
Collect data for each of the interesting predicate.
Field- specifies the field to use as key in each pair.
Pair- is a term of the following format:
              TimeSelf, TimeSiblings,
              Calls, Redo, Recursive,
Source predicate_label(+Head, -Label)[private]
Create a human-readable label for the given head
Source predicate_functor_name(+Head, -Name)[private]
Return the (module-free) name of the predicate for sorting purposes.

Undocumented predicates

The following predicates are exported, but not or incorrectly documented.

Source profile(Arg1, Arg2)