debian/0000755000000000000000000000000011772211401007162 5ustar debian/copyright0000644000000000000000000000441511771262231011127 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: time Upstream-Contact: bug-gnu-utils@gnu.org Source: http://ftp.gnu.org/pub/gnu/time/time-1.7.tar.gz Comment: This is Debian GNU/Linux's prepackaged version of the FSF's GNU time utility. `time' is a program that measures many of the CPU resources, such as time and memory, that other programs use. It was written by David Keppel. It was subsequently maintained and improved by David MacKenzie with help from Arne Henrik Juul, and Francois Pinard. . This package was put together by Dirk Eddelbuettel from the previous Debian package time-1.6-2 (from ftp.debian.org) and the GNU sources for time-1.6. The package was subsequently maintained and updated by Tollef Fog Heen, Salvatore Bonaccorso, and Bob Proulx. Files: * Copyright: Copyright 1987-1996 Free Software Foundation, Inc. License: GPL-2+ Files: debian/* Copyright: Copyright 1995 Peter Tobias Copyright 1995-2004 Dirk Eddelbuettel Copyright 2005, 2008 Tollef Fog Heen Copyright 2010 Salvatore Bonaccorso Copyright 2012 Bob Proulx License: GPL-2+ Files: debian/time.1 Copyright: Copyright 1996 Dirk Eddelbuettel License: freely redistributable Copyright Dirk Eddelbuettel but freely redistributable License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. debian/rules0000755000000000000000000000041211767730207010255 0ustar #!/usr/bin/make -f %: dh $@ --with autoreconf override_dh_installdocs: texi2html -monolithic time.texi dh_installdocs time.html override_dh_installman: dh_installman debian/time.1 override_dh_installinfo: dh_installinfo rm -f debian/time/usr/share/info/dir debian/time.docs0000644000000000000000000000002411741131725010774 0ustar AUTHORS README NEWS debian/watch0000644000000000000000000000007211767525253010233 0ustar version=3 http://ftp.gnu.org/gnu/time/ time-(.*)\.tar\.gz debian/patches/0000755000000000000000000000000011771744236010631 5ustar debian/patches/quiet.patch0000644000000000000000000000436211767715025013005 0ustar Description: Adds -q,--quiet functionality. Requested by Adam Heath. Author: Dirk Eddelbuettel Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=56853 --- time-1.7.orig/time.texi +++ time-1.7/time.texi @@ -185,6 +191,10 @@ sys %S @end example +@item -q +@itemx --quiet +Suppress non-zero error code from the executed program. + @item -v @itemx --verbose @cindex format --- time-1.7.orig/time.c +++ time-1.7/time.c @@ -147,6 +147,10 @@ NULL }; + +/* If true, do not show the exit message */ +static boolean quiet; + /* If true, show an English description next to each statistic. */ static boolean verbose; @@ -172,6 +176,7 @@ {"help", no_argument, NULL, 'h'}, {"output-file", required_argument, NULL, 'o'}, {"portability", no_argument, NULL, 'p'}, + {"quiet", no_argument,NULL, 'q'}, {"verbose", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, {NULL, no_argument, NULL, 0} @@ -333,7 +338,8 @@ else if (WIFSIGNALED (resp->waitstatus)) fprintf (fp, "Command terminated by signal %d\n", WTERMSIG (resp->waitstatus)); - else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus)) + else if (WIFEXITED (resp->waitstatus) && WEXITSTATUS (resp->waitstatus) + && !quiet) fprintf (fp, "Command exited with non-zero status %d\n", WEXITSTATUS (resp->waitstatus)); @@ -523,6 +529,7 @@ char *format; /* Format found in environment. */ /* Initialize the option flags. */ + quiet = false; verbose = false; outfile = NULL; outfp = stderr; @@ -536,7 +543,7 @@ if (format) output_format = format; - while ((optc = getopt_long (argc, argv, "+af:o:pvV", longopts, (int *) 0)) + while ((optc = getopt_long (argc, argv, "+af:o:pqvV", longopts, (int *) 0)) != EOF) { switch (optc) @@ -555,6 +562,9 @@ case 'p': output_format = posix_format; break; + case 'q': + quiet = true; + break; case 'v': verbose = true; break; @@ -657,7 +667,7 @@ fprintf (stream, "\ Usage: %s [-apvV] [-f format] [-o file] [--append] [--verbose]\n\ [--portability] [--format=format] [--output=file] [--version]\n\ - [--help] command [arg...]\n", + [--quiet] [--help] command [arg...]\n", program_name); exit (status); } debian/patches/bug-address.patch0000644000000000000000000000170411767715041014051 0ustar Description: Update bug reporting address. * Reported by Faheem Mitha. Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542469 Author: Bob Proulx --- time-1.7.orig/README +++ time-1.7/README @@ -8,6 +8,6 @@ See the file INSTALL for compilation and installation instructions. Mail suggestions and bug reports for GNU time to -bug-gnu-utils@prep.ai.mit.edu. Please include the version of +bug-gnu-utils@gnu.org. Please include the version of `time', which you can get by running `time --version', and the operating system and C compiler you used. --- time-1.7.orig/time.texi +++ time-1.7/time.texi @@ -137,7 +143,7 @@ @end example Mail suggestions and bug reports for GNU @code{time} to -@code{bug-gnu-utils@@prep.ai.mit.edu}. Please include the version of +@code{bug-gnu-utils@@gnu.org}. Please include the version of @code{time}, which you can get by running @samp{time --version}, and the operating system and C compiler you used. debian/patches/info-nav.patch0000644000000000000000000000623211771744236013372 0ustar Description: Fix info navigation structure In the original when using the standalone 'info' program pressing spacebar does not navigate through the pages. This patch restructures the node navigation somewhat to enable this to happen. Reported by Russ Allbery. Author: Bob Proulx --- a/time.texi +++ b/time.texi @@ -70,7 +70,10 @@ by the Foundation. @end titlepage -@node Top, , (dir), (dir) +@contents + +@node Top +@top The GNU @code{time} Command @ifinfo This file documents the the GNU @code{time} command for running programs @@ -80,30 +83,12 @@ @menu * Resource Measurement:: Measuring program resource use. - - --- The Detailed Node Listing --- - -Measuring Program Resource Use - -* Setting Format:: Selecting the information reported by @code{time}. -* Format String:: The information @code{time} can report. -* Redirecting:: Writing the information to a file. -* Examples:: Examples of using @code{time}. -* Accuracy:: Limitations on the accuracy of @code{time} output. -* Invoking time:: Summary of the options to the @code{time} command. - -The Format String - -* Time Resources:: -* Memory Resources:: -* I/O Resources:: -* Command Info:: +* Concept index:: Index of concepts. @end menu -@node Resource Measurement, , , Top +@node Resource Measurement @chapter Measuring Program Resource Use -@findex time -@kindex time +@cindex time invocation @pindex time @pindex measurement @@ -125,7 +110,7 @@ time @r{[}option@dots{}@r{]} @var{command} @r{[}@var{arg}@dots{}@r{]} @end example -@kindex resources +@cindex resource specifiers @code{time} runs the program @var{command}, with any given arguments @var{arg}@dots{}. When @var{command} finishes, @code{time} displays information about resources used by @var{command}. @@ -197,7 +182,7 @@ @item -v @itemx --verbose -@cindex format +@cindex verbose format Use the built-in verbose format, which displays each available piece of information on the program's resource use on its own line, with an English description of its meaning. @@ -207,7 +192,6 @@ @section The Format String @cindex format -@kindex resource The @dfn{format string} controls the contents of the @code{time} output. It consists of @dfn{resource specifiers} and @dfn{escapes}, interspersed with plain text. @@ -450,7 +434,7 @@ @node Accuracy @section Accuracy -@kindex error (in measurement) +@cindex error (in measurement) The elapsed time is not collected atomically with the execution of the program; as a result, in bizarre circumstances (if the @code{time} @@ -489,7 +473,7 @@ time @r{[}option@dots{}@r{]} @var{command} @r{[}@var{arg}@dots{}@r{]} @end example -@kindex resources +@cindex resources @code{time} runs the program @var{command}, with any given arguments @var{arg}@dots{}. When @var{command} finishes, @code{time} displays information about resources used by @var{command} (on the standard error @@ -524,7 +508,7 @@ @item -v @itemx --verbose -@cindex format +@cindex verbose option Use the built-in verbose format. @item -V @@ -533,5 +517,9 @@ Print the version number of @code{time} and exit. @end table -@contents +@node Concept index +@unnumbered Concept index + +@printindex cp + @bye debian/patches/rusage-portability.patch0000644000000000000000000000204611767715025015501 0ustar Subject: struct rusage and sys/resource.h portability fix Author: Dirk Eddelbuettel Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=144819 --- time-1.7.orig/resuse.h +++ time-1.7/resuse.h @@ -36,19 +36,8 @@ # include #else # define TV_MSEC tv_usec / 1000 -# if HAVE_WAIT3 +# if HAVE_SYS_RESOURCE_H # include -# else -/* Process resource usage structure. */ -struct rusage -{ - struct timeval ru_utime; /* User time used. */ - struct timeval ru_stime; /* System time used. */ - int ru_maxrss, ru_ixrss, ru_idrss, ru_isrss, - ru_minflt, ru_majflt, ru_nswap, ru_inblock, - ru_oublock, ru_msgsnd, ru_msgrcv, ru_nsignals, - ru_nvcsw, ru_nivcsw; -}; # endif #endif --- time-1.7.orig/configure.in +++ time-1.7/configure.in @@ -15,7 +11,7 @@ dnl Checks for header files. AC_HEADER_STDC AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h) +AC_CHECK_HEADERS(unistd.h string.h sys/rusage.h sys/resource.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST debian/patches/configure.patch0000644000000000000000000000133011767715044013630 0ustar Description: Update configure.in file to current format for autoconf version 2.x. * Modernize the configure.in file to current autoconf style. * No need to rename to configure.ac since configure.in still works fine. Author: Bob Proulx --- time-1.7.orig/configure.in +++ time-1.7/configure.in @@ -1,11 +1,7 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(time.c) -VERSION=1.7 -AC_SUBST(VERSION) -PACKAGE=time -AC_SUBST(PACKAGE) -AC_ARG_PROGRAM +AC_INIT([time],[1.7]) +AM_INIT_AUTOMAKE([-Wall]) dnl Checks for programs. AC_PROG_CC @@ -39,4 +35,5 @@ AC_MSG_RESULT($have_gp) test $have_gp = yes && AC_DEFINE(HAVE_GETPAGESIZE) -AC_OUTPUT(Makefile) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT debian/patches/non-normal-exit.patch0000644000000000000000000000134711767714363014711 0ustar Subject: Adjust non-normal exit code * Introduced in Debian time version 1.7-16 * time.c: When time exits in a non-normal way, return 128 plus the number of the signal which caused time to stop or abort. Thanks to Steve Greenland and Herbert Xu for some clarification in this matter. Author: Dirk Eddelbuettel --- time-1.7.orig/time.c +++ time-1.7/time.c @@ -642,9 +652,9 @@ fflush (outfp); if (WIFSTOPPED (res.waitstatus)) - exit (WSTOPSIG (res.waitstatus)); + exit (WSTOPSIG (res.waitstatus) + 128); else if (WIFSIGNALED (res.waitstatus)) - exit (WTERMSIG (res.waitstatus)); + exit (WTERMSIG (res.waitstatus) + 128); else if (WIFEXITED (res.waitstatus)) exit (WEXITSTATUS (res.waitstatus)); } debian/patches/info-direntry.patch0000644000000000000000000000107511767713611014444 0ustar Description: Add a directory entry to the info page. This patch seems to have always been part of the package but its origin is undocumented. Author: Debian --- time-1.7.orig/time.texi +++ time-1.7/time.texi @@ -11,6 +11,12 @@ @finalout @end iftex +@dircategory Individual utilities +@direntry +* time: (time). Run programs and summarize + system resource usage. +@end direntry + @ifinfo This file documents the the GNU @code{time} command for running programs and summarizing the system resources they use. debian/patches/series0000644000000000000000000000022011771744424012037 0ustar non-normal-exit.patch ru_maxrss.patch rusage-portability.patch quiet.patch bug-address.patch configure.patch info-direntry.patch info-nav.patch debian/patches/ru_maxrss.patch0000644000000000000000000000102711767715031013671 0ustar Subject: Fix ru_maxrss reporting Author: Richard Kettlewell Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649402 --- time-1.7.orig/time.c +++ time-1.7/time.c @@ -392,7 +398,7 @@ ptok ((UL) resp->ru.ru_ixrss) / MSEC_TO_TICKS (v)); break; case 'M': /* Maximum resident set size. */ - fprintf (fp, "%lu", ptok ((UL) resp->ru.ru_maxrss)); + fprintf (fp, "%lu", (UL) resp->ru.ru_maxrss); break; case 'O': /* Outputs. */ fprintf (fp, "%ld", resp->ru.ru_oublock); debian/compat0000644000000000000000000000000211767521175010400 0ustar 9 debian/changelog0000644000000000000000000002167511771747305011067 0ustar time (1.7-24) unstable; urgency=low * New maintainer. Thanks Tollef Fog Heen. (Closes: #652670) * Thanks to previous maintainers for all of their efforts! * Acknowledge NMU for Build-Depends automake. Thanks Salvatore Bonaccorso. (Closes: #592620) * Update to new standards version 3.9.3. * Update to new compat level 9. * Use new machine readable copyright file format. * Convert package build system to debhelper dh build system. * Convert package build to "3.0 quilt". Unwind diff.gz patches. Use DEP3 format for patch tagging. * Use dh_installinfo instead of install-info from postinst scripts. Thanks Riku Saikkonen, Hans Spaans. (Closes: #617935, #598099) * ru_maxrss is reported in KBytes not pages. Thanks Richard Kettlewell, Sven Hartrumpf, Miles Bader. (Closes: #649402) * Update bug report email addresses. Thanks Faheem Mitha. (Closes: #542469) * Improve capitalization in short description. Thanks Filipus Klutiero. (Closes: #492669) * Fix man page roff formatting. Thanks Bjarni Ingi Gislason. (Closes: #663260) * Fix man page formatting oddities. Thanks Russ Allbery for the nice patch. See Bug#677013#68 for the discussion. * Fix texinfo standalone info program navigation oddity. Reported by Russ Allbery. See Bug#677013#63. -- Bob Proulx Mon, 23 Feb 2012 12:55:30 -0700 time (1.7-23.1) unstable; urgency=low * Non-maintainer upload. * debian/control: Change Build-Depends on automaken to an alternate dependency automake | automaken (Closes: #592620). -- Salvatore Bonaccorso Mon, 13 Sep 2010 22:31:46 +0200 time (1.7-23) unstable; urgency=medium * Fix up install-info calls in postinst and prerm. Closes: #491410 -- Tollef Fog Heen Mon, 21 Jul 2008 12:27:09 +0200 time (1.7-22) unstable; urgency=low * Fix duplicated lines in man page. Closes: #398610 -- Tollef Fog Heen Fri, 18 Jul 2008 13:27:20 +0200 time (1.7-21) unstable; urgency=low * _Really_ switch maintainer. Thanks to tbm for spotting this. -- Tollef Fog Heen Sun, 6 Feb 2005 15:41:26 +0100 time (1.7-20) unstable; urgency=low * New maintainer. -- Tollef Fog Heen Sun, 6 Feb 2005 12:40:40 +0100 time (1.7-19) unstable; urgency=low * debian/rules: Rewrite snippet for last fix so that it actually works -- Dirk Eddelbuettel Sat, 1 May 2004 08:20:36 -0500 time (1.7-18) unstable; urgency=low * debian/rules: Older versions of automake do not agree with the current version of our install-info; /usr/share/info/dir{,.old}.gz are left behind as a result iff /sbin:/usr/sbin are in the PATH as is the case in Debian's autobuilders -- we now remove them at the end of 'make install'. (Closes: #246778) -- Dirk Eddelbuettel Sat, 1 May 2004 07:55:00 -0500 time (1.7-17) unstable; urgency=low * Daniel Schepler kindly supplied the following: - configure.in: Add AM_MAINTAINER_MODE, to avoid problems with time stamp skew in the source package. Closes: #208193. * Applied Daniel's patches with minor changes, and ran 'aclocal; autoconf; automake-1.7 --gnu --add-missing --copy' * debian/control: Increased Standards-Version to 3.6.1.0 -- Dirk Eddelbuettel Mon, 1 Sep 2003 14:06:20 -0500 time (1.7-16) unstable; urgency=low * time.c: When time exits in a non-normal way, return 128 plus the number of the signal which caused time to stop or abort. Thanks to Steve Greenland and Herbert Xu for some clarification in this matter. * debian/time.1: Corrected typo, thanks Justin Pryzby (Closes: #201021) * debian/time.1: Documented exit code, and change above (Closes: #203804) * debian/time.1: Documented that bash users want /usr/bin/time * debian/rules: Converted to cdbs * debian/control: Added cdbs to Build-Depends, increased debhelper version * debian/control: automake Build-Depends changed to automaken * debian/control: Increase Standards-Version to 3.6.0 -- Dirk Eddelbuettel Mon, 4 Aug 2003 21:03:47 -0500 time (1.7-15) unstable; urgency=low * debian/control: Add automake to Build-Depends (Closes: #146512) * Makefile.in: s/@AUTOMAKE@/automake/ -- Dirk Eddelbuettel Sat, 11 May 2002 09:46:30 -0500 time (1.7-14) unstable; urgency=low * debian/time.1: Small clarification regarding -P flag (Closes: #146414) * configure.in, resuse.h, time.texi: Applied patch kindly provided by Albert Chin which fixes 144819 better -- Dirk Eddelbuettel Thu, 9 May 2002 20:18:47 -0500 time (1.7-13) unstable; urgency=low * resuse.h: Apply small patch to load sys/resource.h (Closes: #144819) -- Dirk Eddelbuettel Mon, 29 Apr 2002 20:32:22 -0500 time (1.7-12) unstable; urgency=low * debian/copyright: Debian/GNU Linux typo fix (lintian) * debian/{pre,post}{inst,rm}: cleanups (lintian) -- Dirk Eddelbuettel Sat, 13 Apr 2002 11:42:46 -0500 time (1.7-11) unstable; urgency=low * debian/control: Added texinfo to Build-Depends (Closes: #90411) -- Dirk Eddelbuettel Tue, 20 Mar 2001 20:27:30 -0600 time (1.7-10) unstable; urgency=low * debian/control: Added Build-Depends -- Dirk Eddelbuettel Thu, 4 Jan 2001 20:43:22 -0600 time (1.7-9) frozen unstable; urgency=low * time.c: Wrote minimal patch which adds a `-q|--quiet' options to suppress non-zero return code from the measured program (Closes: #56853) * debian/time.1: Updated to reflect new option * time.texi: Updated to reflect new option -- Dirk Eddelbuettel Tue, 8 Feb 2000 21:52:10 -0500 time (1.7-8) unstable; urgency=low * debian/preinst: Recognise "install" option (Closes: #51128) -- Dirk Eddelbuettel Tue, 23 Nov 1999 19:30:32 -0500 time (1.7-7) unstable; urgency=low * debian/preinst: Added to remove dhelp file if one is found -- this is needed because time_1.7-4's postrm does not call update-menus on upgrade (Closes: #46576) -- Dirk Eddelbuettel Fri, 15 Oct 1999 22:27:50 -0400 time (1.7-6) unstable; urgency=low * debian/menu: Change reference to /usr/share/doc/time (Closes: #46576) -- Dirk Eddelbuettel Mon, 4 Oct 1999 20:48:32 -0400 time (1.7-5) unstable; urgency=low * debian/rules: Adapted to use /usr/share/ following the recommendation on FHS transition from the Technical Committee * debian/rules: Test for debhelper >= 2.0.40 for FHS compliance * debian/control: Upgraded to Debian Policy 3.0.1 -- Dirk Eddelbuettel Sat, 2 Oct 1999 16:00:28 -0400 Old Changelog: time (1.7-4) unstable; urgency=low, Closes=31767 * debian/{rules,postinst,postrm}: Removed support for html documentation through menu as it is already provided by doc-base (fixes #31767) -- Dirk Eddelbuettel Thu, 14 Jan 1999 20:42:16 -0500 time (1.7-3) unstable; urgency=low, Closes=31164 * Upgraded to Debian Policy 2.5.0.0 (no change) * Added doc-base support (fixes #31164) -- Dirk Eddelbuettel Tue, 5 Jan 1999 20:43:41 -0500 time (1.7-2) unstable; urgency=low * Updated FSF address in copyright (lintian) * Upgraded to Debian Policy 2.4.0.0 * Converted debian/rules to debhelper -- Dirk Eddelbuettel Sat, 11 Apr 1998 10:11:24 -0400 time (1.7-1) unstable; urgency=low * Upgraded to new upstream version * Compiled with GNU libc2 aka libc6 (fixes premature bug #11739) * Now ships the unmodified upstream source as time-1.7.orig.tar.gz * Changed debian/rules to also creates time.html via texi2html * Added menu entry for html documentation -- Dirk Eddelbuettel Sat, 2 Aug 1997 16:14:13 -0400 time (1.6-7) unstable; urgency=low * Added INSTALL_PROGRAM='install -c -s' to strip binary (fixes #7135) -- Dirk Eddelbuettel Sat, 8 Feb 1997 22:18:37 -0500 time (1.6-6) unstable; urgency=low * Applied patch to time.1 by Herbert.Thielen@lpr.e-technik.tu-muenchen.de * Converted package management files to Debian Standard 2.1.2.2. * Changed maintainer email address to -- Dirk Eddelbuettel Wed, 15 Jan 1997 21:46:39 -0500 Mon Apr 15 18:37:42 1996 Dirk Eddelbuettel * time-1.6-5 release * time.1: added a man page (fixes bug#2269) * debian.control: added Architecture field Sun Dec 3 20:52:18 1995 Dirk Eddelbuettel * time-1.6-4 release * debian.control: ELF release, depends on libc5 Thu Jul 27 12:16:18 EDT 1995 Dirk Eddelbuettel * time-1.6-3 release * maintainer changed, more explicit description in debian.control Last update: 08/04/95 Peter Tobias * applied a patch from Robert Sanders (wait3/rusage) debian/time.html0000644000000000000000000010554211767531562011036 0ustar Measuring Program Resource Use:
[Top] [Contents] [Index] [ ? ]

Measuring Program Resource Use

This file documents the the GNU time command for running programs and summarizing the system resources they use. This is edition 1.7, for version 1.7.

1. Measuring Program Resource Use  Measuring program resource use.

 -- The Detailed Node Listing ---

Measuring Program Resource Use

1.1 Setting the Output Format  Selecting the information reported by time.
1.2 The Format String  The information time can report.
1.3 Redirecting Output  Writing the information to a file.
1.4 Examples  Examples of using time.
1.5 Accuracy  Limitations on the accuracy of time output.
1.6 Running the time Command  Summary of the options to the time command.

The Format String

1.2.1 Time Resources  
1.2.2 Memory Resources  
1.2.3 I/O Resources  
1.2.4 Command Info  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1. Measuring Program Resource Use

The time command runs another program, then displays information about the resources used by that program, collected by the system while the program was running. You can select which information is reported and the format in which it is shown (see section 1.1 Setting the Output Format), or have time save the information in a file instead of displaying it on the screen (see section 1.3 Redirecting Output).

The resources that time can report on fall into the general categories of time, memory, and I/O and IPC calls. Some systems do not provide much information about program resource use; time reports unavailable information as zero values (see section 1.5 Accuracy).

The format of the time command is:

 
time [option...] command [arg...]

time runs the program command, with any given arguments arg.... When command finishes, time displays information about resources used by command.

Here is an example of using time to measure the time and other resources used by running the program grep:

 
eg$ time grep nobody /etc/aliases
nobody:/dev/null
etc-files:nobody
misc-group:nobody
0.07user 0.50system 0:06.69elapsed 8%CPU (0avgtext+489avgdata 324maxresident)k
46inputs+7outputs (43major+251minor)pagefaults 0swaps

Mail suggestions and bug reports for GNU time to bug-gnu-utils@gnu.org. Please include the version of time, which you can get by running `time --version', and the operating system and C compiler you used.

1.1 Setting the Output Format  Selecting the information reported by time.
1.2 The Format String  The information time can report.
1.3 Redirecting Output  Writing the information to a file.
1.4 Examples  Examples of using time.
1.5 Accuracy  Limitations on the accuracy of time output.
1.6 Running the time Command  Summary of the options to the time command.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.1 Setting the Output Format

time uses a format string to determine which information to display about the resources used by the command it runs. See section 1.2 The Format String, for the interpretation of the format string contents.

You can specify a format string with the command line options listed below. If no format is specified on the command line, but the TIME environment variable is set, its value is used as the format string. Otherwise, the default format built into time is used:

 
%Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
%Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps

The command line options to set the format are:

-f format
--format=format
Use format as the format string.

-p
--portability
Use the following format string, for conformance with POSIX standard 1003.2:

 
real %e
user %U
sys %S

-q
--quiet
Suppress non-zero error code from the executed program.

-v
--verbose
Use the built-in verbose format, which displays each available piece of information on the program's resource use on its own line, with an English description of its meaning.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2 The Format String

The format string controls the contents of the time output. It consists of resource specifiers and escapes, interspersed with plain text.

A backslash introduces an escape, which is translated into a single printing character upon output. The valid escapes are listed below. An invalid escape is output as a question mark followed by a backslash.

\t
a tab character

\n
a newline

\\
a literal backslash

time always prints a newline after printing the resource use information, so normally format strings do not end with a newline character (or `\n').

A resource specifier consists of a percent sign followed by another character. An invalid resource specifier is output as a question mark followed by the invalid character. Use `%%' to output a literal percent sign.

The resource specifiers, which are a superset of those recognized by the tcsh builtin time command, are listed below. Not all resources are measured by all versions of Unix, so some of the values might be reported as zero (see section 1.5 Accuracy).

1.2.1 Time Resources  
1.2.2 Memory Resources  
1.2.3 I/O Resources  
1.2.4 Command Info  


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2.1 Time Resources

E
Elapsed real (wall clock) time used by the process, in [hours:]minutes:seconds.

e
Elapsed real (wall clock) time used by the process, in seconds.

S
Total number of CPU-seconds used by the system on behalf of the process (in kernel mode), in seconds.

U
Total number of CPU-seconds that the process used directly (in user mode), in seconds.

P
Percentage of the CPU that this job got. This is just user + system times divied by the total running time.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2.2 Memory Resources

M
Maximum resident set size of the process during its lifetime, in Kilobytes.

t
Average resident set size of the process, in Kilobytes.

K
Average total (data+stack+text) memory use of the process, in Kilobytes.

D
Average size of the process's unshared data area, in Kilobytes.

p
Average size of the process's unshared stack, in Kilobytes.

X
Average size of the process's shared text, in Kilobytes.

Z
System's page size, in bytes. This is a per-system constant, but varies between systems.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2.3 I/O Resources

F
Number of major, or I/O-requiring, page faults that occurred while the process was running. These are faults where the page has actually migrated out of primary memory.

R
Number of minor, or recoverable, page faults. These are pages that are not valid (so they fault) but which have not yet been claimed by other virtual pages. Thus the data in the page is still valid but the system tables must be updated.

W
Number of times the process was swapped out of main memory.

c
Number of times the process was context-switched involuntarily (because the time slice expired).

w
Number of times that the program was context-switched voluntarily, for instance while waiting for an I/O operation to complete.

I
Number of file system inputs by the process.

O
Number of file system outputs by the process.

r
Number of socket messages received by the process.

s
Number of socket messages sent by the process.

k
Number of signals delivered to the process.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.2.4 Command Info

C
Name and command line arguments of the command being timed.

x
Exit status of the command.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.3 Redirecting Output

By default, time writes the resource use statistics to the standard error stream. The options below make it write the statistics to a file instead. Doing this can be useful if the program you're running writes to the standard error or you're running time noninteractively or in the background.

-o file
--output=file
Write the resource use statistics to file. By default, this overwrites the file, destroying the file's previous contents.

-a
--append
Append the resource use information to the output file instead of overwriting it. This option is only useful with the `-o' or `--output' option.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.4 Examples

Run the command `wc /etc/hosts' and show the default information:

 
eg$ time wc /etc/hosts
      35     111    1134 /etc/hosts
0.00user 0.01system 0:00.04elapsed 25%CPU (0avgtext+0avgdata 0maxresident)k
1inputs+1outputs (0major+0minor)pagefaults 0swaps

Run the command `ls -Fs' and show just the user, system, and wall-clock time:

 
eg$ time -f "\t%E real,\t%U user,\t%S sys" ls -Fs
total 16
1 account/      1 db/           1 mail/         1 run/
1 backups/      1 emacs/        1 msgs/         1 rwho/
1 crash/        1 games/        1 preserve/     1 spool/
1 cron/         1 log/          1 quotas/       1 tmp/
        0:00.03 real,   0.00 user,      0.01 sys

Edit the file `.bashrc' and have time append the elapsed time and number of signals to the file `log', reading the format string from the environment variable TIME:

 
eg$ export TIME="\t%E,\t%k" # If using bash or ksh
eg$ setenv TIME "\t%E,\t%k" # If using csh or tcsh
eg$ time -a -o log emacs .bashrc
eg$ cat log
        0:16.55,        726

Run the command `sleep 4' and show all of the information about it verbosely:

 
eg$ time -v sleep 4
        Command being timed: "sleep 4"
        User time (seconds): 0.00
        System time (seconds): 0.05
        Percent of CPU this job got: 1%
        Elapsed (wall clock) time (h:mm:ss or m:ss): 0:04.26
        Average shared text size (kbytes): 36
        Average unshared data size (kbytes): 24
        Average stack size (kbytes): 0
        Average total size (kbytes): 60
        Maximum resident set size (kbytes): 32
        Average resident set size (kbytes): 24
        Major (requiring I/O) page faults: 3
        Minor (reclaiming a frame) page faults: 0
        Voluntary context switches: 11
        Involuntary context switches: 0
        Swaps: 0
        File system inputs: 3
        File system outputs: 1
        Socket messages sent: 0
        Socket messages received: 0
        Signals delivered: 1
        Page size (bytes): 4096
        Exit status: 0


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.5 Accuracy

The elapsed time is not collected atomically with the execution of the program; as a result, in bizarre circumstances (if the time command gets stopped or swapped out in between when the program being timed exits and when time calculates how long it took to run), it could be much larger than the actual execution time.

When the running time of a command is very nearly zero, some values (e.g., the percentage of CPU used) may be reported as either zero (which is wrong) or a question mark.

Most information shown by time is derived from the wait3 system call. The numbers are only as good as those returned by wait3. Many systems do not measure all of the resources that time can report on; those resources are reported as zero. The systems that measure most or all of the resources are based on 4.2 or 4.3BSD. Later BSD releases use different memory management code that measures fewer resources.

On systems that do not have a wait3 call that returns status information, the times system call is used instead. It provides much less information than wait3, so on those systems time reports most of the resources as zero.

The `%I' and `%O' values are allegedly only "real" input and output and do not include those supplied by caching devices. The meaning of "real" I/O reported by `%I' and `%O' may be muddled for workstations, especially diskless ones.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

1.6 Running the time Command

The format of the time command is:

 
time [option...] command [arg...]

time runs the program command, with any given arguments arg.... When command finishes, time displays information about resources used by command (on the standard error output, by default). If command exits with non-zero status or is terminated by a signal, time displays a warning message and the exit status or signal number.

Options to time must appear on the command line before command. Anything on the command line after command is passed as arguments to command.

-o file
--output=file
Write the resource use statistics to file.

-a
--append
Append the resource use information to the output file instead of overwriting it.

-f format
--format=format
Use format as the format string.

--help
Print a summary of the command line options to time and exit.

-p
--portability
Use the POSIX format.

-v
--verbose
Use the built-in verbose format.

-V
--version
Print the version number of time and exit.


[Top] [Contents] [Index] [ ? ]

Table of Contents

1. Measuring Program Resource Use
1.1 Setting the Output Format
1.2 The Format String
1.2.1 Time Resources
1.2.2 Memory Resources
1.2.3 I/O Resources
1.2.4 Command Info
1.3 Redirecting Output
1.4 Examples
1.5 Accuracy
1.6 Running the time Command

[Top] [Contents] [Index] [ ? ]

Short Table of Contents

1. Measuring Program Resource Use

[Top] [Contents] [Index] [ ? ]

About this document

This document was generated using texi2html

The buttons in the navigation panels have the following meaning:

Button Name Go to From 1.2.3 go to
[ < ] Back previous section in reading order 1.2.2
[ > ] Forward next section in reading order 1.2.4
[ << ] FastBack previous or up-and-previous section 1.1
[ Up ] Up up section 1.2
[ >> ] FastForward next or up-and-next section 1.3
[Top] Top cover (top) of document  
[Contents] Contents table of contents  
[Index] Index concept index  
[ ? ] About this page  

where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
  • 1. Section One
    • 1.1 Subsection One-One
      • ...
    • 1.2 Subsection One-Two
      • 1.2.1 Subsubsection One-Two-One
      • 1.2.2 Subsubsection One-Two-Two
      • 1.2.3 Subsubsection One-Two-Three     <== Current Position
      • 1.2.4 Subsubsection One-Two-Four
    • 1.3 Subsection One-Three
      • ...
    • 1.4 Subsection One-Four


This document was generated by root on June, 22 2003 using texi2html debian/doc-base0000644000000000000000000000101411725131773010571 0ustar Document: time Title: The GNU time Command Author: David MacKenzie Abstract: The GNU 'time' command runs another program, then displays information about the resources used by that program, collected by the system while the program was running. You can select which information is reported and the format in which it is shown, or have `time' save the information in a file instead of display it on the screen. Section: Programming Format: HTML Index: /usr/share/doc/time/time.html Files: /usr/share/doc/time/time.html debian/control0000644000000000000000000000173111767715451010611 0ustar Source: time Section: utils Priority: standard Maintainer: Bob Proulx Standards-Version: 3.9.3 Build-Depends: debhelper (>= 9), texi2html, texinfo, automake | automaken, autoconf, dh-autoreconf Package: time Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: GNU time program for measuring CPU resource usage The 'time' command runs another program, then displays information about the resources used by that program, collected by the system while the program was running. You can select which information is reported and the format in which it is shown, or have 'time' save the information in a file instead of display it on the screen. . The resources that 'time' can report on fall into the general categories of time, memory, I/O, and IPC calls. . The GNU version can format the output in arbitrary ways by using a printf-style format string to include various resource measurements. Homepage: http://www.gnu.org/software/time debian/time.10000644000000000000000000002244111771442417010221 0ustar .\" Man page added by Dirk Eddelbuettel on 15 Apr 1996 .\" Thanks to Herbert Thielen for a patch .\" Copyright (C) Dirk Eddelbuettel but freely redistributable .TH TIME 1 "Debian GNU/Linux" .\" Always turn off hyphenation; it makes way too many mistakes in .\" technical documents. .nh .SH NAME time \- run programs and summarize system resource usage .SH SYNOPSIS .na .TP .B time [ .B \-apqvV ] [ .BI \-f " FORMAT" ] [ .BI \-o " FILE" ] .br [ .B \-\-append ] [ .B \-\-verbose ] [ .B \-\-quiet ] [ .B \-\-portability ] .br [ .BI \-\-format= "FORMAT" ] [ .BI \-\-output= "FILE" ] [ .B \-\-version ] .br [ .B \-\-help ] .I COMMAND [ .I ARGS ] .ad b .\" For nroff, turn off justification. .if n .ad l .SH DESCRIPTION .B time run the program .I COMMAND with any given arguments .IR "ARG..." . When .I COMMAND finishes, .B time displays information about resources used by .I COMMAND (on the standard error output, by default). If .I COMMAND exits with non\-zero status, .B time displays a warning message and the exit status. .B time determines which information to display about the resources used by the .I COMMAND from the string .IR FORMAT . If no format is specified on the command line, but the .B TIME environment variable is set, its value is used as the format. Otherwise, a default format built into .B time is used. Options to .B time must appear on the command line before .IR COMMAND . Anything on the command line after .I COMMAND is passed as arguments to .IR COMMAND . .SH OPTIONS .TP .BI \-o " FILE, " \-\-output= "FILE " Write the resource use statistics to .I FILE instead of to the standard error stream. By default, this overwrites the file, destroying the file's previous contents. This option is useful for collecting information on interactive programs and programs that produce output on the standard error stream. .TP .BR \-a ", " \-\-append "" Append the resource use information to the output file instead of overwriting it. This option is only useful with the `\-o' or `\-\-output' option. .TP .BI \-f " FORMAT, " \-\-format " FORMAT " Use .I FORMAT as the format string that controls the output of .BR time . See the below more information. .TP .B \-\-help Print a summary of the command line options and exit. .TP .BR \-p ", " \-\-portability "" Use the following format string, for conformance with POSIX standard 1003.2: real %e user %U sys %S .TP .BR \-v ", " \-\-verbose "" Use the built\-in verbose format, which displays each available piece of information on the program's resource use on its own line, with an English description of its meaning. .TP .B \-\-quiet Do not report the status of the program even if it is different from zero. .TP .BR \-V ", " \-\-version "" Print the version number of .B time and exit. .SH "FORMATTING THE OUTPUT" The format string .I FORMAT controls the contents of the .B time output. The format string can be set using the `\-f' or `\-\-format', `\-v' or `\-\-verbose', or `\-p' or `\-\-portability' options. If they are not given, but the .I TIME environment variable is set, its value is used as the format string. Otherwise, a built\-in default format is used. The default format is: %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps The format string usually consists of `resource specifiers' interspersed with plain text. A percent sign (`%') in the format string causes the following character to be interpreted as a resource specifier, which is similar to the formatting characters in the .BR printf (3) function. A backslash (`\\') introduces a `backslash escape', which is translated into a single printing character upon output. `\\t' outputs a tab character, `\\n' outputs a newline, and `\\\\' outputs a backslash. A backslash followed by any other character outputs a question mark (`?') followed by a backslash, to indicate that an invalid backslash escape was given. Other text in the format string is copied verbatim to the output. .B time always prints a newline after printing the resource use information, so normally format strings do not end with a newline character (or `\en'). There are many resource specifications. Not all resources are measured by all versions of Unix, so some of the values might be reported as zero. Any character following a percent sign that is not listed in the table below causes a question mark (`?') to be output, followed by that character, to indicate that an invalid resource specifier was given. .\" No blank line between the resource specifiers below so that they .\" are more compactly listed. .PD 0 The resource specifiers, which are a superset of those recognized by the .BR tcsh (1) builtin `time' command, are: .RS .IP % A literal `%'. .IP C Name and command line arguments of the command being timed. .IP D Average size of the process's unshared data area, in Kilobytes. .IP E Elapsed real (wall clock) time used by the process, in [hours:]minutes:seconds. .IP F Number of major, or I/O\-requiring, page faults that occurred while the process was running. These are faults where the page has actually migrated out of primary memory. .IP I Number of file system inputs by the process. .IP K Average total (data+stack+text) memory use of the process, in Kilobytes. .IP M Maximum resident set size of the process during its lifetime, in Kilobytes. .IP O Number of file system outputs by the process. .IP P Percentage of the CPU that this job got. This is just user + system times divided by the total running time. It also prints a percentage sign. .IP R Number of minor, or recoverable, page faults. These are pages that are not valid (so they fault) but which have not yet been claimed by other virtual pages. Thus the data in the page is still valid but the system tables must be updated. .IP S Total number of CPU\-seconds used by the system on behalf of the process (in kernel mode), in seconds. .IP U Total number of CPU\-seconds that the process used directly (in user mode), in seconds. .IP W Number of times the process was swapped out of main memory. .IP X Average amount of shared text in the process, in Kilobytes. .IP Z System's page size, in bytes. This is a per\-system constant, but varies between systems. .IP c Number of times the process was context\-switched involuntarily (because the time slice expired). .IP e Elapsed real (wall clock) time used by the process, in seconds. .IP k Number of signals delivered to the process. .IP p Average unshared stack size of the process, in Kilobytes. .IP r Number of socket messages received by the process. .IP s Number of socket messages sent by the process. .IP t Average resident set size of the process, in Kilobytes. .IP w Number of times that the program was context\-switched voluntarily, for instance while waiting for an I/O operation to complete. .IP x Exit status of the command. .RS .SH EXAMPLES To run the command `wc /etc/hosts' and show the default information: time wc /etc/hosts To run the command `ls \-Fs' and show just the user, system, and total time: time \-f "\et%E real,\et%U user,\et%S sys" ls \-Fs To edit the file BORK and have `time' append the elapsed time and number of signals to the file `log', reading the format string from the environment variable `TIME': export TIME="\et%E,\et%k" # If using bash or ksh setenv TIME "\et%E,\et%k" # If using csh or tcsh time \-a \-o log emacs bork Users of the .B bash shell need to use an explicit path in order to run the external .B time command and not the shell builtin variant. On system where .B time is installed in .IR /usr/bin , the first example would become /usr/bin/time wc /etc/hosts .SH ACCURACY The elapsed time is not collected atomically with the execution of the program; as a result, in bizarre circumstances (if the .B time command gets stopped or swapped out in between when the program being timed exits and when .B time calculates how long it took to run), it could be much larger than the actual execution time. When the running time of a command is very nearly zero, some values (e.g., the percentage of CPU used) may be reported as either zero (which is wrong) or a question mark. Most information shown by .B time is derived from the .BR wait3 (2) system call. The numbers are only as good as those returned by .BR wait3 (2). On systems that do not have a .BR wait3 (2) call that returns status information, the .BR times (2) system call is used instead. However, it provides much less information than .BR wait3 (2), so on those systems .B time reports the majority of the resources as zero. The `%I' and `%O' values are allegedly only `real' input and output and do not include those supplied by caching devices. The meaning of `real' I/O reported by `%I' and `%O' may be muddled for workstations, especially diskless ones. .SH DIAGNOSTICS The .B time command returns when the program exits, stops, or is terminated by a signal. If the program exited normally, the return value of .B time is the return value of the program it executed and measured. Otherwise, the return value is 128 plus the number of the signal which caused the program to stop or terminate. .SH AUTHOR .B time was written by David MacKenzie. This man page was added by Dirk Eddelbuettel , the Debian GNU/Linux maintainer, for use by the Debian GNU/Linux distribution but may of course be used by others. .SH "SEE ALSO" .BR tcsh (1), .BR printf (3) debian/source/0000755000000000000000000000000011767726022010500 5ustar debian/source/format0000644000000000000000000000001411767534476011720 0ustar 3.0 (quilt) debian/source/options0000644000000000000000000000010111767726022012106 0ustar extend-diff-ignore = "(^|/)(time\.info|version.texi|stamp-vti)$" debian/time.info0000644000000000000000000000001211725116567011005 0ustar time.info