1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<META name="GENERATOR" content="hevea 1.08">
<LINK rel="stylesheet" type="text/css" href="gprolog.css">
<TITLE>
System statistics
</TITLE>
</HEAD>
<BODY TEXT=black BGCOLOR=white>
<A HREF="gprolog046.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="gprolog023.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="gprolog048.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
<HR>
<H3 CLASS="subsection"><A NAME="htoc231">7.24</A> System statistics</H3><UL>
<LI><A HREF="gprolog047.html#toc186"><TT>statistics/0</TT>,
<TT>statistics/2</TT></A>
<LI><A HREF="gprolog047.html#toc187"><TT>user_time/1</TT>,
<TT>system_time/1</TT>,
<TT>cpu_time/1</TT>,
<TT>real_time/1</TT></A>
</UL>
<A NAME="toc186"></A>
<H4 CLASS="subsubsection"><A NAME="htoc232">7.24.1</A> <TT>statistics/0</TT>,
<TT>statistics/2</TT></H4>
<B>Templates</B>
<DL CLASS="list" COMPACT="compact"><DT CLASS="dt-list"><DD CLASS="dd-list"><TT>
statistics<BR>
statistics(?atom, ?list)</TT></DL>
<B>Description</B><BR>
<BR>
<TT>statistics</TT> displays statistics about memory usage and run times.<BR>
<BR>
<TT>statistics(Key, Value)</TT> unifies <TT>Value</TT> with the current
value of the statistics key <TT>Key</TT>. <TT>Value</TT> a list of two
elements. Times are in milliseconds, sizes of areas in bytes.<BR>
<TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD ALIGN=left NOWRAP>Key</TD>
<TD ALIGN=left NOWRAP>Description</TD>
<TD ALIGN=left NOWRAP>Value</TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>user_time</TT></TD>
<TD ALIGN=left NOWRAP>user CPU time</TD>
<TD ALIGN=left NOWRAP><TT>[SinceStart, SinceLast]</TT></TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>system_time</TT></TD>
<TD ALIGN=left NOWRAP>system CPU time</TD>
<TD ALIGN=left NOWRAP><TT>[SinceStart, SinceLast]</TT></TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>cpu_time</TT></TD>
<TD ALIGN=left NOWRAP>total CPU time (user + system)</TD>
<TD ALIGN=left NOWRAP><TT>[SinceStart,
SinceLast]</TT></TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>real_time</TT></TD>
<TD ALIGN=left NOWRAP>absolute time</TD>
<TD ALIGN=left NOWRAP><TT>[SinceStart, SinceLast]</TT></TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>local_stack</TT></TD>
<TD ALIGN=left NOWRAP>local stack sizes (control, environments, choices)</TD>
<TD ALIGN=left NOWRAP><TT>[UsedSize, FreeSize]</TT></TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>global_stack</TT></TD>
<TD ALIGN=left NOWRAP>global stack sizes (compound terms)</TD>
<TD ALIGN=left NOWRAP><TT>[UsedSize, FreeSize]</TT></TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>trail_stack</TT></TD>
<TD ALIGN=left NOWRAP>trail stack sizes (variable bindings to undo)</TD>
<TD ALIGN=left NOWRAP><TT>[UsedSize, FreeSize]</TT></TD>
</TR>
<TR><TD ALIGN=left NOWRAP><TT>cstr_stack</TT></TD>
<TD ALIGN=left NOWRAP>constraint trail sizes (finite domain constraints)</TD>
<TD ALIGN=left NOWRAP><TT>[UsedSize, FreeSize]</TT></TD>
</TR></TABLE><BR>
Note that the key <TT>runtime</TT> is recognized as <TT>user_time</TT> for
compatibility purpose.<BR>
<BR>
<B>Errors</B><BR>
<TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Key</TT> is neither a variable nor a valid key</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>domain_error(statistics_key, Key)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Value</TT> is neither a variable nor a list of two elements</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>domain_error(statistics_value, Value)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Value</TT> is a list of two elements and an element <TT>E</TT>
is neither a variable nor an integer</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(integer, E)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR></TABLE><BR>
<B>Portability</B><BR>
<BR>
GNU Prolog predicates.<BR>
<BR>
<A NAME="toc187"></A>
<H4 CLASS="subsubsection"><A NAME="htoc233">7.24.2</A> <TT>user_time/1</TT>,
<TT>system_time/1</TT>,
<TT>cpu_time/1</TT>,
<TT>real_time/1</TT></H4>
<A NAME="user-time/1"></A>
<B>Templates</B>
<DL CLASS="list" COMPACT="compact"><DT CLASS="dt-list"><DD CLASS="dd-list"><TT>
user_time(?integer)<BR>
system_time(?integer)<BR>
cpu_time(?integer)<BR>
real_time(?integer)</TT></DL>
<B>Description</B><BR>
<BR>
<TT>user_time(Time)</TT> unifies <TT>Time</TT> with the user
CPU time elapsed since the start of Prolog.<BR>
<BR>
<TT>system_time(Time)</TT> unifies <TT>Time</TT> with the
system CPU time elapsed since the start of Prolog.<BR>
<BR>
<TT>cpu_time(Time)</TT> unifies <TT>Time</TT> with the CPU
time (user + system) elapsed since the start of Prolog.<BR>
<BR>
<TT>real_time(Time)</TT> unifies <TT>Time</TT> with the
absolute time elapsed since the start of Prolog.<BR>
<BR>
<B>Errors</B><BR>
<TABLE CELLSPACING=2 CELLPADDING=0>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left><TT>Time</TT> is neither a variable nor an integer</TD>
<TD VALIGN=top ALIGN=center NOWRAP> </TD>
<TD VALIGN=top ALIGN=left><TT>type_error(integer, Time)</TT></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN=3><TABLE BORDER=0 WIDTH="100%" CELLSPACING=0 CELLPADDING=1><TR><TD></TD></TR></TABLE></TD>
</TR></TABLE><BR>
<B>Portability</B><BR>
<BR>
GNU Prolog predicates.<BR>
<BR>
<HR SIZE=2>
Copyright (C) 1999-2007 Daniel Diaz
<BR>
<BR>
Verbatim copying and distribution of this entire article is permitted in any
medium, provided this notice is preserved. <BR>
<BR>
<A HREF="index.html#copyright">More about the copyright</A>
<HR>
<A HREF="gprolog046.html"><IMG SRC ="previous_motif.gif" ALT="Previous"></A>
<A HREF="gprolog023.html"><IMG SRC ="contents_motif.gif" ALT="Up"></A>
<A HREF="gprolog048.html"><IMG SRC ="next_motif.gif" ALT="Next"></A>
</BODY>
</HTML>
|