summaryrefslogtreecommitdiffstats
path: root/meta/packages/time/files
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-12-14 09:20:58 +0000
committerRichard Purdie <richard@openedhand.com>2006-12-14 09:20:58 +0000
commit51d58201daff8bc499b4a52277e65e185e1880a8 (patch)
tree3472c6797fd8268ce9fed9914048f64139f924a5 /meta/packages/time/files
parentd2e7d8bbba5277db71a99a1194f89a2f7d848e64 (diff)
downloadpoky-51d58201daff8bc499b4a52277e65e185e1880a8.tar.gz
Add time
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@1031 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/time/files')
-rw-r--r--meta/packages/time/files/debian.patch1299
1 files changed, 1299 insertions, 0 deletions
diff --git a/meta/packages/time/files/debian.patch b/meta/packages/time/files/debian.patch
new file mode 100644
index 0000000000..40df19da45
--- /dev/null
+++ b/meta/packages/time/files/debian.patch
@@ -0,0 +1,1299 @@
1--- time-1.7.orig/configure.in
2+++ time-1.7/configure.in
3@@ -1,11 +1,8 @@
4 dnl Process this file with autoconf to produce a configure script.
5 AC_INIT(time.c)
6-VERSION=1.7
7-AC_SUBST(VERSION)
8-PACKAGE=time
9-AC_SUBST(PACKAGE)
10+AM_INIT_AUTOMAKE(time, 1.7)
11
12-AC_ARG_PROGRAM
13+AM_MAINTAINER_MODE
14
15 dnl Checks for programs.
16 AC_PROG_CC
17@@ -15,7 +12,7 @@
18 dnl Checks for header files.
19 AC_HEADER_STDC
20 AC_HEADER_SYS_WAIT
21-AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h)
22+AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h sys/resource.h)
23
24 dnl Checks for typedefs, structures, and compiler characteristics.
25 AC_C_CONST
26--- time-1.7.orig/version.texi
27+++ time-1.7/version.texi
28@@ -1,3 +1,3 @@
29-@set UPDATED 12 June 1996
30+@set UPDATED 9 May 2002
31 @set EDITION 1.7
32 @set VERSION 1.7
33--- time-1.7.orig/time.c
34+++ time-1.7/time.c
35@@ -147,6 +147,10 @@
36 NULL
37 };
38
39+
40+/* If true, do not show the exit message */
41+static boolean quiet;
42+
43 /* If true, show an English description next to each statistic. */
44 static boolean verbose;
45
46@@ -172,6 +176,7 @@
47 {"help", no_argument, NULL, 'h'},
48 {"output-file", required_argument, NULL, 'o'},
49 {"portability", no_argument, NULL, 'p'},
50+ {"quiet", no_argument,NULL, 'q'},
51 {"verbose", no_argument, NULL, 'v'},
52 {"version", no_argument, NULL, 'V'},
53 {NULL, no_argument, NULL, 0}
54@@ -333,7 +338,8 @@
55 else if (WIFSIGNALED (resp->waitstatus))
56 fprintf (fp, "Command terminated by signal %d\n",
57 WTERMSIG (resp->waitstatus));
58- else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus))
59+ else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus)
60+ && !quiet)
61 fprintf (fp, "Command exited with non-zero status %d\n",
62 WEXITSTATUS (resp->waitstatus));
63
64@@ -523,6 +529,7 @@
65 char *format; /* Format found in environment. */
66
67 /* Initialize the option flags. */
68+ quiet = false;
69 verbose = false;
70 outfile = NULL;
71 outfp = stderr;
72@@ -536,7 +543,7 @@
73 if (format)
74 output_format = format;
75
76- while ((optc = getopt_long (argc, argv, "+af:o:pvV", longopts, (int *) 0))
77+ while ((optc = getopt_long (argc, argv, "+af:o:pqvV", longopts, (int *) 0))
78 != EOF)
79 {
80 switch (optc)
81@@ -555,6 +562,9 @@
82 case 'p':
83 output_format = posix_format;
84 break;
85+ case 'q':
86+ quiet = true;
87+ break;
88 case 'v':
89 verbose = true;
90 break;
91@@ -642,9 +652,9 @@
92 fflush (outfp);
93
94 if (WIFSTOPPED (res.waitstatus))
95- exit (WSTOPSIG (res.waitstatus));
96+ exit (WSTOPSIG (res.waitstatus) + 128);
97 else if (WIFSIGNALED (res.waitstatus))
98- exit (WTERMSIG (res.waitstatus));
99+ exit (WTERMSIG (res.waitstatus) + 128);
100 else if (WIFEXITED (res.waitstatus))
101 exit (WEXITSTATUS (res.waitstatus));
102 }
103@@ -657,7 +667,7 @@
104 fprintf (stream, "\
105 Usage: %s [-apvV] [-f format] [-o file] [--append] [--verbose]\n\
106 [--portability] [--format=format] [--output=file] [--version]\n\
107- [--help] command [arg...]\n",
108+ [--quiet] [--help] command [arg...]\n",
109 program_name);
110 exit (status);
111 }
112--- time-1.7.orig/resuse.h
113+++ time-1.7/resuse.h
114@@ -36,19 +36,8 @@
115 # include <sys/rusage.h>
116 #else
117 # define TV_MSEC tv_usec / 1000
118-# if HAVE_WAIT3
119+# if HAVE_SYS_RESOURCE_H
120 # include <sys/resource.h>
121-# else
122-/* Process resource usage structure. */
123-struct rusage
124-{
125- struct timeval ru_utime; /* User time used. */
126- struct timeval ru_stime; /* System time used. */
127- int ru_maxrss, ru_ixrss, ru_idrss, ru_isrss,
128- ru_minflt, ru_majflt, ru_nswap, ru_inblock,
129- ru_oublock, ru_msgsnd, ru_msgrcv, ru_nsignals,
130- ru_nvcsw, ru_nivcsw;
131-};
132 # endif
133 #endif
134
135--- time-1.7.orig/time.texi
136+++ time-1.7/time.texi
137@@ -11,6 +11,12 @@
138 @finalout
139 @end iftex
140
141+@dircategory Individual utilities
142+@direntry
143+* time: (time). Run programs and summarize
144+ system resource usage.
145+@end direntry
146+
147 @ifinfo
148 This file documents the the GNU @code{time} command for running programs
149 and summarizing the system resources they use.
150@@ -185,6 +191,10 @@
151 sys %S
152 @end example
153
154+@item -q
155+@itemx --quiet
156+Suppress non-zero error code from the executed program.
157+
158 @item -v
159 @itemx --verbose
160 @cindex format
161--- time-1.7.orig/time.info
162+++ time-1.7/time.info
163@@ -1,5 +1,10 @@
164-This is Info file ./time.info, produced by Makeinfo-1.55 from the input
165-file time.texi.
166+This is time.info, produced by makeinfo version 4.1 from time.texi.
167+
168+INFO-DIR-SECTION Individual utilities
169+START-INFO-DIR-ENTRY
170+* time: (time). Run programs and summarize
171+ system resource usage.
172+END-INFO-DIR-ENTRY
173
174 This file documents the the GNU `time' command for running programs
175 and summarizing the system resources they use.
176@@ -31,7 +36,7 @@
177
178 * Resource Measurement:: Measuring program resource use.
179
180- -- The Detailed Node Listing --
181+ --- The Detailed Node Listing ---
182
183 Measuring Program Resource Use
184
185@@ -58,14 +63,14 @@
186 The `time' command runs another program, then displays information
187 about the resources used by that program, collected by the system while
188 the program was running. You can select which information is reported
189-and the format in which it is shown (*note Setting Format::.), or have
190+and the format in which it is shown (*note Setting Format::), or have
191 `time' save the information in a file instead of displaying it on the
192-screen (*note Redirecting::.).
193+screen (*note Redirecting::).
194
195 The resources that `time' can report on fall into the general
196 categories of time, memory, and I/O and IPC calls. Some systems do not
197 provide much information about program resource use; `time' reports
198-unavailable information as zero values (*note Accuracy::.).
199+unavailable information as zero values (*note Accuracy::).
200
201 The format of the `time' command is:
202
203@@ -132,6 +137,10 @@
204 user %U
205 sys %S
206
207+`-q'
208+`--quiet'
209+ Suppress non-zero error code from the executed program.
210+
211 `-v'
212 `--verbose'
213 Use the built-in verbose format, which displays each available
214@@ -174,7 +183,7 @@
215 The resource specifiers, which are a superset of those recognized by
216 the `tcsh' builtin `time' command, are listed below. Not all resources
217 are measured by all versions of Unix, so some of the values might be
218-reported as zero (*note Accuracy::.).
219+reported as zero (*note Accuracy::).
220
221 * Menu:
222
223@@ -308,11 +317,11 @@
224 `-o FILE'
225 `--output=FILE'
226 Write the resource use statistics to FILE. By default, this
227- *overwrites* the file, destroying the file's previous contents.
228+ _overwrites_ the file, destroying the file's previous contents.
229
230 `-a'
231 `--append'
232- *Append* the resource use information to the output file instead
233+ _Append_ the resource use information to the output file instead
234 of overwriting it. This option is only useful with the `-o' or
235 `--output' option.
236
237@@ -437,7 +446,7 @@
238
239 `-a'
240 `--append'
241- *Append* the resource use information to the output file instead
242+ _Append_ the resource use information to the output file instead
243 of overwriting it.
244
245 `-f FORMAT'
246@@ -462,17 +471,17 @@
247
248 
249 Tag Table:
250-Node: Top934
251-Node: Resource Measurement1725
252-Node: Setting Format3678
253-Node: Format String4907
254-Node: Time Resources6214
255-Node: Memory Resources6844
256-Node: I/O Resources7549
257-Node: Command Info8747
258-Node: Redirecting8964
259-Node: Examples9754
260-Node: Accuracy12064
261-Node: Invoking time13586
262+Node: Top1115
263+Node: Resource Measurement1908
264+Node: Setting Format3858
265+Node: Format String5164
266+Node: Time Resources6470
267+Node: Memory Resources7100
268+Node: I/O Resources7805
269+Node: Command Info9003
270+Node: Redirecting9220
271+Node: Examples10010
272+Node: Accuracy12320
273+Node: Invoking time13842
274 
275 End Tag Table
276--- time-1.7.orig/time.html
277+++ time-1.7/time.html
278@@ -0,0 +1,1021 @@
279+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
280+ "http://www.w3.org/TR/html40/loose.dtd">
281+<HTML>
282+<!-- Created on September, 1 2003 by texi2html 1.66 -->
283+<!--
284+Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
285+ Karl Berry <karl@freefriends.org>
286+ Olaf Bachmann <obachman@mathematik.uni-kl.de>
287+ and many others.
288+Maintained by: Many creative people <dev@texi2html.cvshome.org>
289+Send bugs and suggestions to <users@texi2html.cvshome.org>
290+
291+-->
292+<HEAD>
293+<TITLE>Measuring Program Resource Use</TITLE>
294+
295+<META NAME="description" CONTENT="Measuring Program Resource Use">
296+<META NAME="keywords" CONTENT="Measuring Program Resource Use">
297+<META NAME="resource-type" CONTENT="document">
298+<META NAME="distribution" CONTENT="global">
299+<META NAME="Generator" CONTENT="texi2html 1.66">
300+
301+</HEAD>
302+
303+<BODY LANG="en" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
304+
305+<A NAME="SEC_Top"></A>
306+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
307+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
308+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
309+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
310+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
311+</TR></TABLE>
312+<H1>Measuring Program Resource Use</H1>
313+
314+<P>
315+
316+This file documents the the GNU <CODE>time</CODE> command for running programs
317+and summarizing the system resources they use.
318+This is edition 1.7, for version 1.7.
319+</P>
320+<P>
321+
322+</P>
323+<TABLE BORDER="0" CELLSPACING="0">
324+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC1">1. Measuring Program Resource Use</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Measuring program resource use.</TD></TR>
325+<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
326+</TH></TR>
327+<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP"> -- The Detailed Node Listing ---
328+</TH></TR>
329+<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
330+</TH></TR>
331+<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">Measuring Program Resource Use
332+</TH></TR>
333+<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
334+</TH></TR>
335+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC2">1.1 Setting the Output Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Selecting the information reported by <CODE>time</CODE>.</TD></TR>
336+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC3">1.2 The Format String</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The information <CODE>time</CODE> can report.</TD></TR>
337+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC8">1.3 Redirecting Output</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Writing the information to a file.</TD></TR>
338+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC9">1.4 Examples</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Examples of using <CODE>time</CODE>.</TD></TR>
339+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC10">1.5 Accuracy</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Limitations on the accuracy of <CODE>time</CODE> output.</TD></TR>
340+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Summary of the options to the <CODE>time</CODE> command.</TD></TR>
341+<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
342+</TH></TR>
343+<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">The Format String
344+</TH></TR>
345+<TR><TH COLSPAN="3" ALIGN="left" VALIGN="TOP">
346+</TH></TR>
347+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC4">1.2.1 Time Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
348+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC5">1.2.2 Memory Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
349+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC6">1.2.3 I/O Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
350+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC7">1.2.4 Command Info</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
351+</TABLE>
352+<P>
353+
354+<HR SIZE=1>
355+<A NAME="SEC1"></A>
356+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
357+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> &lt; </A>]</TD>
358+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC2"> &gt; </A>]</TD>
359+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
360+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
361+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
362+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
363+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
364+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
365+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
366+</TR></TABLE>
367+<A NAME="Resource Measurement"></A>
368+<H1> 1. Measuring Program Resource Use </H1>
369+<!--docid::SEC1::-->
370+<P>
371+
372+The <CODE>time</CODE> command runs another program, then displays information
373+about the resources used by that program, collected by the system while
374+the program was running. You can select which information is reported
375+and the format in which it is shown (see section <A HREF="time.html#SEC2">1.1 Setting the Output Format</A>), or have
376+<CODE>time</CODE> save the information in a file instead of displaying it on the
377+screen (see section <A HREF="time.html#SEC8">1.3 Redirecting Output</A>).
378+</P>
379+<P>
380+
381+The resources that <CODE>time</CODE> can report on fall into the general
382+categories of time, memory, and I/O and IPC calls. Some systems do not
383+provide much information about program resource use; <CODE>time</CODE>
384+reports unavailable information as zero values (see section <A HREF="time.html#SEC10">1.5 Accuracy</A>).
385+</P>
386+<P>
387+
388+The format of the <CODE>time</CODE> command is:
389+</P>
390+<P>
391+
392+<TABLE><tr><td>&nbsp;</td><td class=example><pre>time [option<small>...</small>] <VAR>command</VAR> [<VAR>arg</VAR><small>...</small>]
393+</pre></td></tr></table><P>
394+
395+<A NAME="IDX1"></A>
396+<CODE>time</CODE> runs the program <VAR>command</VAR>, with any given arguments
397+<VAR>arg</VAR><small>...</small>. When <VAR>command</VAR> finishes, <CODE>time</CODE> displays
398+information about resources used by <VAR>command</VAR>.
399+</P>
400+<P>
401+
402+Here is an example of using <CODE>time</CODE> to measure the time and other
403+resources used by running the program <CODE>grep</CODE>:
404+</P>
405+<P>
406+
407+<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time grep nobody /etc/aliases
408+nobody:/dev/null
409+etc-files:nobody
410+misc-group:nobody
411+0.07user 0.50system 0:06.69elapsed 8%CPU (0avgtext+489avgdata 324maxresident)k
412+46inputs+7outputs (43major+251minor)pagefaults 0swaps
413+</pre></td></tr></table><P>
414+
415+Mail suggestions and bug reports for GNU <CODE>time</CODE> to
416+<CODE>bug-gnu-utils@prep.ai.mit.edu</CODE>. Please include the version of
417+<CODE>time</CODE>, which you can get by running `<SAMP>time --version</SAMP>', and the
418+operating system and C compiler you used.
419+</P>
420+<P>
421+
422+<TABLE BORDER="0" CELLSPACING="0">
423+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC2">1.1 Setting the Output Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Selecting the information reported by <CODE>time</CODE>.</TD></TR>
424+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC3">1.2 The Format String</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">The information <CODE>time</CODE> can report.</TD></TR>
425+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC8">1.3 Redirecting Output</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Writing the information to a file.</TD></TR>
426+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC9">1.4 Examples</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Examples of using <CODE>time</CODE>.</TD></TR>
427+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC10">1.5 Accuracy</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Limitations on the accuracy of <CODE>time</CODE> output.</TD></TR>
428+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Summary of the options to the <CODE>time</CODE> command.</TD></TR>
429+</TABLE>
430+<P>
431+
432+<A NAME="Setting Format"></A>
433+<HR SIZE="6">
434+<A NAME="SEC2"></A>
435+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
436+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt; </A>]</TD>
437+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC3"> &gt; </A>]</TD>
438+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
439+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
440+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
441+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
442+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
443+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
444+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
445+</TR></TABLE>
446+<H2> 1.1 Setting the Output Format </H2>
447+<!--docid::SEC2::-->
448+<P>
449+
450+<CODE>time</CODE> uses a <EM>format string</EM> to determine which information to
451+display about the resources used by the command it runs. See section <A HREF="time.html#SEC3">1.2 The Format String</A>, for the interpretation of the format string contents.
452+</P>
453+<P>
454+
455+You can specify a format string with the command line options listed
456+below. If no format is specified on the command line, but the
457+<CODE>TIME</CODE> environment variable is set, its value is used as the format
458+string. Otherwise, the default format built into <CODE>time</CODE> is used:
459+</P>
460+<P>
461+
462+<TABLE><tr><td>&nbsp;</td><td class=example><pre>%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
463+%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps
464+</pre></td></tr></table><P>
465+
466+The command line options to set the format are:
467+</P>
468+<P>
469+
470+</P>
471+<DL COMPACT>
472+<DT><CODE>-f <VAR>format</VAR></CODE>
473+<DD><DT><CODE>--format=<VAR>format</VAR></CODE>
474+<DD>Use <VAR>format</VAR> as the format string.
475+<P>
476+
477+</P>
478+<DT><CODE>-p</CODE>
479+<DD><DT><CODE>--portability</CODE>
480+<DD>Use the following format string, for conformance with POSIX standard
481+1003.2:
482+<P>
483+
484+<TABLE><tr><td>&nbsp;</td><td class=example><pre>real %e
485+user %U
486+sys %S
487+</pre></td></tr></table><P>
488+
489+</P>
490+<DT><CODE>-q</CODE>
491+<DD><DT><CODE>--quiet</CODE>
492+<DD>Suppress non-zero error code from the executed program.
493+<P>
494+
495+</P>
496+<DT><CODE>-v</CODE>
497+<DD><DT><CODE>--verbose</CODE>
498+<DD><A NAME="IDX2"></A>
499+Use the built-in verbose format, which displays each available piece of
500+information on the program's resource use on its own line, with an
501+English description of its meaning.
502+</DL>
503+<P>
504+
505+<A NAME="Format String"></A>
506+<HR SIZE="6">
507+<A NAME="SEC3"></A>
508+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
509+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC2"> &lt; </A>]</TD>
510+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC4"> &gt; </A>]</TD>
511+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
512+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
513+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
514+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
515+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
516+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
517+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
518+</TR></TABLE>
519+<H2> 1.2 The Format String </H2>
520+<!--docid::SEC3::-->
521+<P>
522+
523+<A NAME="IDX3"></A>
524+<A NAME="IDX4"></A>
525+The <EM>format string</EM> controls the contents of the <CODE>time</CODE> output.
526+It consists of <EM>resource specifiers</EM> and <EM>escapes</EM>, interspersed
527+with plain text.
528+</P>
529+<P>
530+
531+A backslash introduces an <EM>escape</EM>, which is translated
532+into a single printing character upon output. The valid escapes are
533+listed below. An invalid escape is output as a question mark followed
534+by a backslash.
535+</P>
536+<P>
537+
538+</P>
539+<DL COMPACT>
540+<DT><CODE>\t</CODE>
541+<DD>a tab character
542+<P>
543+
544+</P>
545+<DT><CODE>\n</CODE>
546+<DD>a newline
547+<P>
548+
549+</P>
550+<DT><CODE>\\</CODE>
551+<DD>a literal backslash
552+</DL>
553+<P>
554+
555+<CODE>time</CODE> always prints a newline after printing the resource use
556+information, so normally format strings do not end with a newline
557+character (or `<SAMP>\n</SAMP>').
558+</P>
559+<P>
560+
561+A resource specifier consists of a percent sign followed by another
562+character. An invalid resource specifier is output as a question mark
563+followed by the invalid character. Use `<SAMP>%%</SAMP>' to output a literal
564+percent sign.
565+</P>
566+<P>
567+
568+The resource specifiers, which are a superset of those recognized by the
569+<CODE>tcsh</CODE> builtin <CODE>time</CODE> command, are listed below. Not all
570+resources are measured by all versions of Unix, so some of the values
571+might be reported as zero (see section <A HREF="time.html#SEC10">1.5 Accuracy</A>).
572+</P>
573+<P>
574+
575+<TABLE BORDER="0" CELLSPACING="0">
576+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC4">1.2.1 Time Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
577+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC5">1.2.2 Memory Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
578+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC6">1.2.3 I/O Resources</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
579+<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="time.html#SEC7">1.2.4 Command Info</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
580+</TABLE>
581+<P>
582+
583+<A NAME="Time Resources"></A>
584+<HR SIZE="6">
585+<A NAME="SEC4"></A>
586+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
587+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC3"> &lt; </A>]</TD>
588+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC5"> &gt; </A>]</TD>
589+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
590+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
591+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
592+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
593+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
594+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
595+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
596+</TR></TABLE>
597+<H3> 1.2.1 Time Resources </H3>
598+<!--docid::SEC4::-->
599+<P>
600+
601+</P>
602+<DL COMPACT>
603+<DT><CODE>E</CODE>
604+<DD>Elapsed real (wall clock) time used by the process, in
605+[hours:]minutes:seconds.
606+<P>
607+
608+</P>
609+<DT><CODE>e</CODE>
610+<DD>Elapsed real (wall clock) time used by the process, in
611+seconds.
612+<P>
613+
614+</P>
615+<DT><CODE>S</CODE>
616+<DD>Total number of CPU-seconds used by the system on behalf of the process
617+(in kernel mode), in seconds.
618+<P>
619+
620+</P>
621+<DT><CODE>U</CODE>
622+<DD>Total number of CPU-seconds that the process used directly (in user
623+mode), in seconds.
624+<P>
625+
626+</P>
627+<DT><CODE>P</CODE>
628+<DD>Percentage of the CPU that this job got. This is just user + system
629+times divied by the total running time.
630+</DL>
631+<P>
632+
633+<A NAME="Memory Resources"></A>
634+<HR SIZE="6">
635+<A NAME="SEC5"></A>
636+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
637+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC4"> &lt; </A>]</TD>
638+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC6"> &gt; </A>]</TD>
639+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
640+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
641+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
642+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
643+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
644+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
645+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
646+</TR></TABLE>
647+<H3> 1.2.2 Memory Resources </H3>
648+<!--docid::SEC5::-->
649+<P>
650+
651+</P>
652+<DL COMPACT>
653+<DT><CODE>M</CODE>
654+<DD>Maximum resident set size of the process during its lifetime, in
655+Kilobytes.
656+<P>
657+
658+</P>
659+<DT><CODE>t</CODE>
660+<DD>Average resident set size of the process, in Kilobytes.
661+<P>
662+
663+</P>
664+<DT><CODE>K</CODE>
665+<DD>Average total (data+stack+text) memory use of the process, in Kilobytes.
666+<P>
667+
668+</P>
669+<DT><CODE>D</CODE>
670+<DD>Average size of the process's unshared data area, in Kilobytes.
671+<P>
672+
673+</P>
674+<DT><CODE>p</CODE>
675+<DD>Average size of the process's unshared stack, in Kilobytes.
676+<P>
677+
678+</P>
679+<DT><CODE>X</CODE>
680+<DD>Average size of the process's shared text, in Kilobytes.
681+<P>
682+
683+</P>
684+<DT><CODE>Z</CODE>
685+<DD>System's page size, in bytes. This is a per-system constant, but
686+varies between systems.
687+</DL>
688+<P>
689+
690+<A NAME="I/O Resources"></A>
691+<HR SIZE="6">
692+<A NAME="SEC6"></A>
693+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
694+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC5"> &lt; </A>]</TD>
695+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC7"> &gt; </A>]</TD>
696+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
697+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
698+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
699+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
700+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
701+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
702+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
703+</TR></TABLE>
704+<H3> 1.2.3 I/O Resources </H3>
705+<!--docid::SEC6::-->
706+<P>
707+
708+</P>
709+<DL COMPACT>
710+<DT><CODE>F</CODE>
711+<DD>Number of major, or I/O-requiring, page faults that occurred while the
712+process was running. These are faults where the page has actually
713+migrated out of primary memory.
714+<P>
715+
716+</P>
717+<DT><CODE>R</CODE>
718+<DD>Number of minor, or recoverable, page faults. These are pages that are
719+not valid (so they fault) but which have not yet been claimed by other
720+virtual pages. Thus the data in the page is still valid but the system
721+tables must be updated.
722+<P>
723+
724+</P>
725+<DT><CODE>W</CODE>
726+<DD>Number of times the process was swapped out of main memory.
727+<P>
728+
729+</P>
730+<DT><CODE>c</CODE>
731+<DD>Number of times the process was context-switched involuntarily (because
732+the time slice expired).
733+<P>
734+
735+</P>
736+<DT><CODE>w</CODE>
737+<DD>Number of times that the program was context-switched voluntarily, for
738+instance while waiting for an I/O operation to complete.
739+<P>
740+
741+</P>
742+<DT><CODE>I</CODE>
743+<DD>Number of file system inputs by the process.
744+<P>
745+
746+</P>
747+<DT><CODE>O</CODE>
748+<DD>Number of file system outputs by the process.
749+<P>
750+
751+</P>
752+<DT><CODE>r</CODE>
753+<DD>Number of socket messages received by the process.
754+<P>
755+
756+</P>
757+<DT><CODE>s</CODE>
758+<DD>Number of socket messages sent by the process.
759+<P>
760+
761+</P>
762+<DT><CODE>k</CODE>
763+<DD>Number of signals delivered to the process.
764+</DL>
765+<P>
766+
767+<A NAME="Command Info"></A>
768+<HR SIZE="6">
769+<A NAME="SEC7"></A>
770+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
771+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC6"> &lt; </A>]</TD>
772+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC8"> &gt; </A>]</TD>
773+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
774+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
775+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
776+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
777+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
778+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
779+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
780+</TR></TABLE>
781+<H3> 1.2.4 Command Info </H3>
782+<!--docid::SEC7::-->
783+<P>
784+
785+</P>
786+<DL COMPACT>
787+<DT><CODE>C</CODE>
788+<DD>Name and command line arguments of the command being timed.
789+<P>
790+
791+</P>
792+<DT><CODE>x</CODE>
793+<DD>Exit status of the command.
794+</DL>
795+<P>
796+
797+<A NAME="Redirecting"></A>
798+<HR SIZE="6">
799+<A NAME="SEC8"></A>
800+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
801+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC7"> &lt; </A>]</TD>
802+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC9"> &gt; </A>]</TD>
803+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
804+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
805+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
806+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
807+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
808+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
809+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
810+</TR></TABLE>
811+<H2> 1.3 Redirecting Output </H2>
812+<!--docid::SEC8::-->
813+<P>
814+
815+By default, <CODE>time</CODE> writes the resource use statistics to the
816+standard error stream. The options below make it write the statistics
817+to a file instead. Doing this can be useful if the program you're
818+running writes to the standard error or you're running <CODE>time</CODE>
819+noninteractively or in the background.
820+</P>
821+<P>
822+
823+</P>
824+<DL COMPACT>
825+<DT><CODE>-o <VAR>file</VAR></CODE>
826+<DD><DT><CODE>--output=<VAR>file</VAR></CODE>
827+<DD>Write the resource use statistics to <VAR>file</VAR>. By default, this
828+<EM>overwrites</EM> the file, destroying the file's previous contents.
829+<P>
830+
831+</P>
832+<DT><CODE>-a</CODE>
833+<DD><DT><CODE>--append</CODE>
834+<DD><EM>Append</EM> the resource use information to the output file instead
835+of overwriting it. This option is only useful with the `<SAMP>-o</SAMP>' or
836+`<SAMP>--output</SAMP>' option.
837+</DL>
838+<P>
839+
840+<A NAME="Examples"></A>
841+<HR SIZE="6">
842+<A NAME="SEC9"></A>
843+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
844+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC8"> &lt; </A>]</TD>
845+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC10"> &gt; </A>]</TD>
846+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
847+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
848+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
849+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
850+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
851+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
852+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
853+</TR></TABLE>
854+<H2> 1.4 Examples </H2>
855+<!--docid::SEC9::-->
856+<P>
857+
858+Run the command `<SAMP>wc /etc/hosts</SAMP>' and show the default information:
859+</P>
860+<P>
861+
862+<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time wc /etc/hosts
863+ 35 111 1134 /etc/hosts
864+0.00user 0.01system 0:00.04elapsed 25%CPU (0avgtext+0avgdata 0maxresident)k
865+1inputs+1outputs (0major+0minor)pagefaults 0swaps
866+</pre></td></tr></table><P>
867+
868+Run the command `<SAMP>ls -Fs</SAMP>' and show just the user, system, and
869+wall-clock time:
870+</P>
871+<P>
872+
873+<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time -f &quot;\t%E real,\t%U user,\t%S sys&quot; ls -Fs
874+total 16
875+1 account/ 1 db/ 1 mail/ 1 run/
876+1 backups/ 1 emacs/ 1 msgs/ 1 rwho/
877+1 crash/ 1 games/ 1 preserve/ 1 spool/
878+1 cron/ 1 log/ 1 quotas/ 1 tmp/
879+ 0:00.03 real, 0.00 user, 0.01 sys
880+</pre></td></tr></table><P>
881+
882+Edit the file `<TT>.bashrc</TT>' and have <CODE>time</CODE> append the elapsed time
883+and number of signals to the file `<TT>log</TT>', reading the format string
884+from the environment variable <CODE>TIME</CODE>:
885+</P>
886+<P>
887+
888+<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ export TIME=&quot;\t%E,\t%k&quot; # If using bash or ksh
889+eg$ setenv TIME &quot;\t%E,\t%k&quot; # If using csh or tcsh
890+eg$ time -a -o log emacs .bashrc
891+eg$ cat log
892+ 0:16.55, 726
893+</pre></td></tr></table><P>
894+
895+Run the command `<SAMP>sleep 4</SAMP>' and show all of the information about it
896+verbosely:
897+</P>
898+<P>
899+
900+<TABLE><tr><td>&nbsp;</td><td class=example><pre>eg$ time -v sleep 4
901+ Command being timed: &quot;sleep 4&quot;
902+ User time (seconds): 0.00
903+ System time (seconds): 0.05
904+ Percent of CPU this job got: 1%
905+ Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.26
906+ Average shared text size (kbytes): 36
907+ Average unshared data size (kbytes): 24
908+ Average stack size (kbytes): 0
909+ Average total size (kbytes): 60
910+ Maximum resident set size (kbytes): 32
911+ Average resident set size (kbytes): 24
912+ Major (requiring I/O) page faults: 3
913+ Minor (reclaiming a frame) page faults: 0
914+ Voluntary context switches: 11
915+ Involuntary context switches: 0
916+ Swaps: 0
917+ File system inputs: 3
918+ File system outputs: 1
919+ Socket messages sent: 0
920+ Socket messages received: 0
921+ Signals delivered: 1
922+ Page size (bytes): 4096
923+ Exit status: 0
924+</pre></td></tr></table><P>
925+
926+<A NAME="Accuracy"></A>
927+<HR SIZE="6">
928+<A NAME="SEC10"></A>
929+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
930+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC9"> &lt; </A>]</TD>
931+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC11"> &gt; </A>]</TD>
932+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
933+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
934+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
935+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
936+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
937+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
938+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
939+</TR></TABLE>
940+<H2> 1.5 Accuracy </H2>
941+<!--docid::SEC10::-->
942+<P>
943+
944+The elapsed time is not collected atomically with the execution of the
945+program; as a result, in bizarre circumstances (if the <CODE>time</CODE>
946+command gets stopped or swapped out in between when the program being
947+timed exits and when <CODE>time</CODE> calculates how long it took to run), it
948+could be much larger than the actual execution time.
949+</P>
950+<P>
951+
952+When the running time of a command is very nearly zero, some values
953+(e.g., the percentage of CPU used) may be reported as either zero (which
954+is wrong) or a question mark.
955+</P>
956+<P>
957+
958+Most information shown by <CODE>time</CODE> is derived from the <CODE>wait3</CODE>
959+system call. The numbers are only as good as those returned by
960+<CODE>wait3</CODE>. Many systems do not measure all of the resources that
961+<CODE>time</CODE> can report on; those resources are reported as zero. The
962+systems that measure most or all of the resources are based on 4.2 or
963+4.3BSD. Later BSD releases use different memory management code that
964+measures fewer resources.
965+</P>
966+<P>
967+
968+On systems that do not have a <CODE>wait3</CODE> call that returns status
969+information, the <CODE>times</CODE> system call is used instead. It provides
970+much less information than <CODE>wait3</CODE>, so on those systems <CODE>time</CODE>
971+reports most of the resources as zero.
972+</P>
973+<P>
974+
975+The `<SAMP>%I</SAMP>' and `<SAMP>%O</SAMP>' values are allegedly only &quot;real&quot; input
976+and output and do not include those supplied by caching devices. The
977+meaning of &quot;real&quot; I/O reported by `<SAMP>%I</SAMP>' and `<SAMP>%O</SAMP>' may be
978+muddled for workstations, especially diskless ones.
979+</P>
980+<P>
981+
982+<A NAME="Invoking time"></A>
983+<HR SIZE="6">
984+<A NAME="SEC11"></A>
985+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
986+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC10"> &lt; </A>]</TD>
987+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt; ]</TD>
988+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC1"> &lt;&lt; </A>]</TD>
989+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top"> Up </A>]</TD>
990+<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</TD>
991+<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
992+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
993+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
994+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
995+</TR></TABLE>
996+<H2> 1.6 Running the <CODE>time</CODE> Command </H2>
997+<!--docid::SEC11::-->
998+<P>
999+
1000+The format of the <CODE>time</CODE> command is:
1001+</P>
1002+<P>
1003+
1004+<TABLE><tr><td>&nbsp;</td><td class=example><pre>time [option<small>...</small>] <VAR>command</VAR> [<VAR>arg</VAR><small>...</small>]
1005+</pre></td></tr></table><P>
1006+
1007+<A NAME="IDX5"></A>
1008+<CODE>time</CODE> runs the program <VAR>command</VAR>, with any given arguments
1009+<VAR>arg</VAR><small>...</small>. When <VAR>command</VAR> finishes, <CODE>time</CODE> displays
1010+information about resources used by <VAR>command</VAR> (on the standard error
1011+output, by default). If <VAR>command</VAR> exits with non-zero status or is
1012+terminated by a signal, <CODE>time</CODE> displays a warning message and the
1013+exit status or signal number.
1014+</P>
1015+<P>
1016+
1017+Options to <CODE>time</CODE> must appear on the command line before
1018+<VAR>command</VAR>. Anything on the command line after <VAR>command</VAR> is
1019+passed as arguments to <VAR>command</VAR>.
1020+</P>
1021+<P>
1022+
1023+</P>
1024+<DL COMPACT>
1025+<DT><CODE>-o <VAR>file</VAR></CODE>
1026+<DD><DT><CODE>--output=<VAR>file</VAR></CODE>
1027+<DD>Write the resource use statistics to <VAR>file</VAR>.
1028+<P>
1029+
1030+</P>
1031+<DT><CODE>-a</CODE>
1032+<DD><DT><CODE>--append</CODE>
1033+<DD><EM>Append</EM> the resource use information to the output file instead
1034+of overwriting it.
1035+<P>
1036+
1037+</P>
1038+<DT><CODE>-f <VAR>format</VAR></CODE>
1039+<DD><DT><CODE>--format=<VAR>format</VAR></CODE>
1040+<DD>Use <VAR>format</VAR> as the format string.
1041+<P>
1042+
1043+</P>
1044+<DT><CODE>--help</CODE>
1045+<DD>Print a summary of the command line options to <CODE>time</CODE> and exit.
1046+<P>
1047+
1048+</P>
1049+<DT><CODE>-p</CODE>
1050+<DD><DT><CODE>--portability</CODE>
1051+<DD>Use the POSIX format.
1052+<P>
1053+
1054+</P>
1055+<DT><CODE>-v</CODE>
1056+<DD><DT><CODE>--verbose</CODE>
1057+<DD><A NAME="IDX6"></A>
1058+Use the built-in verbose format.
1059+<P>
1060+
1061+</P>
1062+<DT><CODE>-V</CODE>
1063+<DD><DT><CODE>--version</CODE>
1064+<DD><A NAME="IDX7"></A>
1065+Print the version number of <CODE>time</CODE> and exit.
1066+</DL>
1067+<P>
1068+
1069+<HR SIZE="6">
1070+<A NAME="SEC_Contents"></A>
1071+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1072+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
1073+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
1074+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
1075+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
1076+</TR></TABLE>
1077+<H1>Table of Contents</H1>
1078+<BLOCKQUOTE>
1079+<A NAME="TOC1" HREF="time.html#SEC1">1. Measuring Program Resource Use</A>
1080+<BR>
1081+<BLOCKQUOTE>
1082+<A NAME="TOC2" HREF="time.html#SEC2">1.1 Setting the Output Format</A>
1083+<BR>
1084+<A NAME="TOC3" HREF="time.html#SEC3">1.2 The Format String</A>
1085+<BR>
1086+<BLOCKQUOTE>
1087+<A NAME="TOC4" HREF="time.html#SEC4">1.2.1 Time Resources</A>
1088+<BR>
1089+<A NAME="TOC5" HREF="time.html#SEC5">1.2.2 Memory Resources</A>
1090+<BR>
1091+<A NAME="TOC6" HREF="time.html#SEC6">1.2.3 I/O Resources</A>
1092+<BR>
1093+<A NAME="TOC7" HREF="time.html#SEC7">1.2.4 Command Info</A>
1094+<BR>
1095+</BLOCKQUOTE>
1096+<A NAME="TOC8" HREF="time.html#SEC8">1.3 Redirecting Output</A>
1097+<BR>
1098+<A NAME="TOC9" HREF="time.html#SEC9">1.4 Examples</A>
1099+<BR>
1100+<A NAME="TOC10" HREF="time.html#SEC10">1.5 Accuracy</A>
1101+<BR>
1102+<A NAME="TOC11" HREF="time.html#SEC11">1.6 Running the <CODE>time</CODE> Command</A>
1103+<BR>
1104+</BLOCKQUOTE>
1105+</BLOCKQUOTE>
1106+<HR SIZE=1>
1107+<A NAME="SEC_OVERVIEW"></A>
1108+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1109+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
1110+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
1111+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
1112+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
1113+</TR></TABLE>
1114+<H1>Short Table of Contents</H1>
1115+<BLOCKQUOTE>
1116+<A NAME="TOC1" HREF="time.html#SEC1">1. Measuring Program Resource Use</A>
1117+<BR>
1118+
1119+</BLOCKQUOTE>
1120+<HR SIZE=1>
1121+<A NAME="SEC_About"></A>
1122+<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
1123+<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Top">Top</A>]</TD>
1124+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_Contents">Contents</A>]</TD>
1125+<TD VALIGN="MIDDLE" ALIGN="LEFT">[Index]</TD>
1126+<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="time.html#SEC_About"> ? </A>]</TD>
1127+</TR></TABLE>
1128+<H1>About this document</H1>
1129+This document was generated
1130+by
1131+using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
1132+<P></P>
1133+The buttons in the navigation panels have the following meaning:
1134+<P></P>
1135+<table border = "1">
1136+<TR>
1137+<TH> Button </TH>
1138+<TH> Name </TH>
1139+<TH> Go to </TH>
1140+<TH> From 1.2.3 go to</TH>
1141+</TR>
1142+<TR>
1143+<TD ALIGN="CENTER">
1144+ [ &lt; ] </TD>
1145+<TD ALIGN="CENTER">
1146+Back
1147+</TD>
1148+<TD>
1149+previous section in reading order
1150+</TD>
1151+<TD>
1152+1.2.2
1153+</TD>
1154+</TR>
1155+<TR>
1156+<TD ALIGN="CENTER">
1157+ [ &gt; ] </TD>
1158+<TD ALIGN="CENTER">
1159+Forward
1160+</TD>
1161+<TD>
1162+next section in reading order
1163+</TD>
1164+<TD>
1165+1.2.4
1166+</TD>
1167+</TR>
1168+<TR>
1169+<TD ALIGN="CENTER">
1170+ [ &lt;&lt; ] </TD>
1171+<TD ALIGN="CENTER">
1172+FastBack
1173+</TD>
1174+<TD>
1175+beginning of this chapter or previous chapter
1176+</TD>
1177+<TD>
1178+1
1179+</TD>
1180+</TR>
1181+<TR>
1182+<TD ALIGN="CENTER">
1183+ [ Up ] </TD>
1184+<TD ALIGN="CENTER">
1185+Up
1186+</TD>
1187+<TD>
1188+up section
1189+</TD>
1190+<TD>
1191+1.2
1192+</TD>
1193+</TR>
1194+<TR>
1195+<TD ALIGN="CENTER">
1196+ [ &gt;&gt; ] </TD>
1197+<TD ALIGN="CENTER">
1198+FastForward
1199+</TD>
1200+<TD>
1201+next chapter
1202+</TD>
1203+<TD>
1204+2
1205+</TD>
1206+</TR>
1207+<TR>
1208+<TD ALIGN="CENTER">
1209+ [Top] </TD>
1210+<TD ALIGN="CENTER">
1211+Top
1212+</TD>
1213+<TD>
1214+cover (top) of document
1215+</TD>
1216+<TD>
1217+ &nbsp;
1218+</TD>
1219+</TR>
1220+<TR>
1221+<TD ALIGN="CENTER">
1222+ [Contents] </TD>
1223+<TD ALIGN="CENTER">
1224+Contents
1225+</TD>
1226+<TD>
1227+table of contents
1228+</TD>
1229+<TD>
1230+ &nbsp;
1231+</TD>
1232+</TR>
1233+<TR>
1234+<TD ALIGN="CENTER">
1235+ [Index] </TD>
1236+<TD ALIGN="CENTER">
1237+Index
1238+</TD>
1239+<TD>
1240+concept index
1241+</TD>
1242+<TD>
1243+ &nbsp;
1244+</TD>
1245+</TR>
1246+<TR>
1247+<TD ALIGN="CENTER">
1248+ [ ? ] </TD>
1249+<TD ALIGN="CENTER">
1250+About
1251+</TD>
1252+<TD>
1253+this page
1254+</TD>
1255+<TD>
1256+ &nbsp;
1257+</TD>
1258+</TR>
1259+</TABLE>
1260+ <P>
1261+ where the <STRONG> Example </STRONG> assumes that the current position
1262+ is at <STRONG> Subsubsection One-Two-Three </STRONG> of a document of
1263+ the following structure:</P>
1264+ <UL>
1265+ <LI> 1. Section One
1266+ <UL>
1267+ <LI>1.1 Subsection One-One
1268+ <UL>
1269+ <LI>...</LI>
1270+ </UL>
1271+ <LI>1.2 Subsection One-Two
1272+ <UL>
1273+ <LI>1.2.1 Subsubsection One-Two-One</LI>
1274+ <LI>1.2.2 Subsubsection One-Two-Two</LI>
1275+ <LI>1.2.3 Subsubsection One-Two-Three &nbsp; &nbsp;
1276+ <STRONG>&lt;== Current Position </STRONG></LI>
1277+ <LI>1.2.4 Subsubsection One-Two-Four</LI>
1278+ </UL>
1279+ </LI>
1280+ <LI>1.3 Subsection One-Three
1281+ <UL>
1282+ <LI>...</LI>
1283+ </UL>
1284+ </LI>
1285+ <LI>1.4 Subsection One-Four</LI>
1286+ </UL>
1287+ </LI>
1288+ </UL>
1289+
1290+<HR SIZE=1>
1291+<BR>
1292+<FONT SIZE="-1">
1293+This document was generated
1294+by <I>root</I> on <I>September, 1 2003</I>
1295+using <A HREF="http://texi2html.cvshome.org"><I>texi2html</I></A>
1296+</FONT>
1297+
1298+</BODY>
1299+</HTML>