Stack + Heap: 12000000 bytes
Stack in use: 824 bytes
Heap in use: 676 bytes
Program area: 8000000 bytes
In use: 1047185 bytes
Trail: 8000000 bytes
In use: 64 bytes
Table area: 4000000 bytes
In use: 0 bytes
Number of GC calls: 0
Numbers of expansions:
Stack + Heap: 0
Program area: 0
Trail: 0
Table: 0
Total GC time: 0 ms
Number of symbols: 5175
FD backtracks: 0
| ?- statistics(Key,Value).
Key = runtime
Value = [633,633]?;
Key = program
Value = [483064,3516936]?;
Key = heap
Value = [364,3999604]?;
Key = control
Value = [32,3999604]?;
Key = trail
Value = [108,1999892]?;
Key = table
Value = [1324,1998676]?;
key = gc
Value = 0?;
Key = backtracks
V = 0 ?;
Key = gc_time
Value = 0
no
The values for all keys are lists of two elements. For runtime,
the first element denotes the amount of time in milliseconds elapsed
since the start of Prolog and the second element denotes the amount of
time elapsed since the previous call to statistics/2 was executed.
For the key gc, the number indicates the number of times the
garbage collector has been invoked ; and for the
key backtracks, the number indicates the number of backtracks done
in labeling of finite domain variables since B-Prolog was started.
For all other keys, the first element denotes the size of memory in use
and the second element denotes the size of memory still available in the
corresponding data area.
cputime(T):-statistics(runtime,[T|_]).
time(Goal):-
cputime(Start),
call(Goal),
cputime(End),
T is (End-Start)/1000,
format(``CPU time ~w seconds. ``, [T]).
Neng-Fa Zhou 2011-05-12