Previous Up Next

8.24  System statistics

8.24.1  statistics/0, statistics/2

Templates

statistics
statistics(?atom, ?list)

Description

statistics displays statistics about memory usage and run times.

statistics(Key, Value) unifies Value with the current value of the statistics key Key. Value a list of two elements. Times are in milliseconds, sizes of areas in bytes.

KeyDescriptionValue
user_timeuser CPU time[SinceStart, SinceLast]
system_timesystem CPU time[SinceStart, SinceLast]
cpu_timetotal CPU time (user + system)[SinceStart, SinceLast]
real_timeabsolute time[SinceStart, SinceLast]
local_stacklocal stack sizes (control, environments, choices)[UsedSize, FreeSize]
global_stackglobal stack sizes (compound terms)[UsedSize, FreeSize]
trail_stacktrail stack sizes (variable bindings to undo)[UsedSize, FreeSize]
cstr_stackconstraint trail sizes (finite domain constraints)[UsedSize, FreeSize]
atomsatom table[NumberOfAtoms, FreeNumberOfAtoms]

Note that the key runtime is recognized as user_time for compatibility purpose.

Errors

Key is neither a variable nor a valid key  domain_error(statistics_key, Key)
Value is neither a variable nor a list of two elements  domain_error(statistics_value, Value)
Value is a list of two elements and an element E is neither a variable nor an integer  type_error(integer, E)

Portability

GNU Prolog predicates.

8.24.2  user_time/1, system_time/1, cpu_time/1, real_time/1

Templates

user_time(?integer)
system_time(?integer)
cpu_time(?integer)
real_time(?integer)

Description

user_time(Time) unifies Time with the user CPU time elapsed since the start of Prolog.

system_time(Time) unifies Time with the system CPU time elapsed since the start of Prolog.

cpu_time(Time) unifies Time with the CPU time (user + system) elapsed since the start of Prolog.

real_time(Time) unifies Time with the absolute time elapsed since the start of Prolog.

Errors

Time is neither a variable nor an integer  type_error(integer, Time)

Portability

GNU Prolog predicates.


Copyright (C) 1999-2013 Daniel Diaz Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. More about the copyright
Previous Up Next