1 .\" Copyright Andries Brouwer, 2000
2 .\" Some fragments of text came from the time-1.7 info file.
3 .\" Inspired by kromJx@crosswinds.net.
5 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
6 .\" Distributed under GPL
9 .TH TIME 1 2019-03-06 "" "Linux User's Manual"
11 time \- time a simple command or give resource usage
13 .BI "time [" options "] " command " [" arguments... "] "
17 command runs the specified program
19 with the given arguments.
24 writes a message to standard error giving timing statistics
25 about this program run.
26 These statistics consist of (i) the elapsed real time
27 between invocation and termination, (ii) the user CPU time
36 and (iii) the system CPU time (the sum of the
45 Note: some shells (e.g.,
49 command that provides similar information on the usage of time and
50 possibly other resources.
51 To access the real command, you may need to specify its pathname
57 When in the POSIX locale, use the precise traditional format
61 "real %f\enuser %f\ensys %f\en"
65 (with numbers in seconds)
66 where the number of decimals in the output for %f is unspecified
67 but is sufficient to express the clock tick accuracy, and at least one.
71 was invoked, the exit status is that of
73 Otherwise, it is 127 if
75 could not be found, 126 if it could be found but could not be invoked,
76 and some other nonzero value (1\(en125) if something else went wrong.
86 are used for the text and formatting of the output.
90 The remaining ones for the text and formatting of the output.
92 Below a description of the GNU 1.7 version of
94 Disregarding the name of the utility, GNU makes it output lots of
95 useful information, not only about time used, but also on other
96 resources like memory, I/O and IPC calls (where available).
97 The output is formatted using a format string that can be specified
102 environment variable.
104 The default format string is:
108 %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
109 %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps
115 option is given, the (portable) output format is used:
125 .SS The format string
126 The format is interpreted in the usual printf-like way.
127 Ordinary characters are directly copied, tab, newline
128 and backslash are escaped using \et, \en and \e\e,
129 a percent sign is represented by %%, and otherwise %
130 indicates a conversion.
133 will always add a trailing newline itself.
134 The conversions follow.
142 Elapsed real time (in [hours:]minutes:seconds).
147 Elapsed real time (in seconds).
150 Total number of CPU-seconds that the process spent in kernel mode.
153 Total number of CPU-seconds that the process spent in user mode.
156 Percentage of the CPU that this job got, computed as (%U + %S) / %E.
161 Maximum resident set size of the process during its lifetime, in Kbytes.
166 Average resident set size of the process, in Kbytes.
169 Average total (data+stack+text) memory use of the process,
173 Average size of the process's unshared data area, in Kbytes.
178 Average size of the process's unshared stack space, in Kbytes.
181 Average size of the process's shared text space, in Kbytes.
186 System's page size, in bytes.
187 This is a per-system constant, but varies between systems.
190 Number of major page faults that occurred while the process was running.
191 These are faults where the page has to be read in from disk.
194 Number of minor, or recoverable, page faults.
195 These are faults for pages that are not valid but which have
196 not yet been claimed by other virtual pages.
198 in the page is still valid but the system tables must be updated.
201 Number of times the process was swapped out of main memory.
204 Number of times the process was context-switched involuntarily
205 (because the time slice expired).
208 Number of waits: times that the program was context-switched voluntarily,
209 for instance while waiting for an I/O operation to complete.
214 Number of filesystem inputs by the process.
217 Number of filesystem outputs by the process.
220 Number of socket messages received by the process.
223 Number of socket messages sent by the process.
226 Number of signals delivered to the process.
231 Name and command-line arguments of the command being timed.
236 Exit status of the command.
239 .BI "\-f " format ", \-\-format=" format
240 Specify output format, possibly overriding the format specified
241 in the environment variable TIME.
243 .B "\-p, \-\-portability"
244 Use the portable output format.
246 .BI "\-o " file ", \-\-output=" file
247 Do not send the results to
249 but overwrite the specified file.
252 (Used together with \-o.) Do not overwrite but append.
254 .B "\-v, \-\-verbose"
255 Give very verbose output about all the program knows about.
258 Don't report abnormal program termination (where
260 is terminated by a signal) or nonzero exit status.
262 .SS GNU standard options
265 Print a usage message on standard output and exit successfully.
267 .B "\-V, \-\-version"
268 Print version information on standard output, then exit successfully.
271 Terminate option list.
273 Not all resources are measured by all versions of UNIX,
274 so some of the values might be reported as zero.
275 The present selection was mostly inspired by the data
276 provided by 4.2 or 4.3BSD.
278 GNU time version 1.7 is not yet localized.
279 Thus, it does not implement the POSIX requirements.
281 The environment variable
284 It is not unusual for systems like
288 to use environment variables with the name of a utility to override
289 the utility to be used.
290 Uses like MORE or TIME for options to programs
291 (instead of program pathnames) tend to lead to difficulties.
293 It seems unfortunate that
295 overwrites instead of appends.
298 option should be the default.)
300 Mail suggestions and bug reports for GNU
303 .IR bug\-time@gnu.org .
304 Please include the version of
306 which you can get by running
314 and the operating system
315 and C compiler you used.
318 .\" .IP "David Keppel"
320 .\" .IP "David MacKenzie"
321 .\" POSIXization, autoconfiscation, GNU getoptization,
322 .\" documentation, other bug fixes and improvements.
323 .\" .IP "Arne Henrik Juul"
324 .\" Helped with portability
325 .\" .IP "Francois Pinard"
326 .\" Helped with portability