[ library(profile) | Reference Manual | Alphabetic Index ]

# profile(+Goal)

Execute Goal (once) and print the time spent in each predicate.

Goal
  Callable term

## Description

This predicate invokes the profiler with default options. Equivalent to:

           profile(Goal, []).

See profile/2 for details.

ECLiPSe must have been started with the -P command line option (or equivalent) in order to support profiling.

### Modes and Determinism

- profile(+) is det

### Modules

This predicate is sensitive to its module context (tool predicate, see @/2).

## Examples

    ?- profile(length(_,100000000)).

    		  PROFILING STATISTICS
    		  --------------------
    Goal:		  length(_80, 100000000)
    Result:		  success
    Sampling rate:	  every 0.01s process_cputime
    Samples taken:	  182
    Thread cputime:	  1.82s

    Predicate	      Module	    %Time    Time   %Cum
    ---------------------------------------------------------
    length            /2  sepia_kernel  79.7%    1.45s  79.7%
    garbage_collect   /0  sepia_kernel  20.3%    0.37s 100.0%

    Yes (1.86s cpu)

## See Also

get_flag / 2, profile / 2