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