InnerhalbNach weiteren Dokumenten suchenSupport-Ressourcen | Dieses Buch im PDF-Format herunterladen (6561 KB)
time(1)Name | Synopsis | Description | Options | Operands | Usage | Examples | Environment Variables | Exit Status | Attributes | See Also | Notes | Bugs Name
Synopsistime [-p] utility [argument]... Description
The time utility invokes utility operand with argument, and writes a message to standard error that lists timing statistics for utility. The message includes the following information: When time is used as part of a pipeline, the times reported are unspecified, except when it is the sole command within a grouping command in that pipeline. For example, the commands on the left are unspecified; those on the right report on utilities a and c, respectively: time a | b | c { time a } | b | c
a | b | time c a | b | (time c)
Options
The following option is supported: Operands
The following operands are supported: UsageThe time utility returns exit status 127 if an error occurs so that applications can distinguish “failure to find a utility” from “invoked utility exited with an error indication.” The value 127 was chosen because it is not commonly used for other meanings. Most utilities use small values for “normal error conditions” and the values above 128 can be confused with termination due to receipt of a signal. The value 126 was chosen in a similar manner to indicate that the utility could be found, but not invoked. ExamplesExample 1 Using the time commandIt is frequently desirable to apply time to pipelines or lists of commands. This can be done by placing pipelines and command lists in a single file. This single file can then be invoked as a utility, and the time applies to everything in the file. Alternatively, the following command can be used to apply time to a complex command:
Example 2 Using time in the csh shellThe following two examples show the differences between the csh version of time and the version in /usr/bin/time. These examples assume that csh is the shell in use.
See csh(1) for an explanation of the format of time output.
Environment VariablesSee environ(5) for descriptions of the following environment variables that affect the execution of time: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, LC_NUMERIC, NLSPATH, and PATH. Exit Status
If utility is invoked, the exit status of time will be the exit status of utility. Otherwise, the time utility will exit with one of the following values: AttributesSee attributes(5) for descriptions of the following attributes:
See AlsoNotesWhen the time command is run on a multiprocessor machine, the total of the values printed for user and sys can exceed real. This is because on a multiprocessor machine it is possible to divide the task between the various processors. When the command being timed is interrupted, the timing values displayed may not always be accurate. BugsElapsed time is accurate to the second, while the CPU times are measured to the 100th second. Thus the sum of the CPU times can be up to a second larger than the elapsed time. Name | Synopsis | Description | Options | Operands | Usage | Examples | Environment Variables | Exit Status | Attributes | See Also | Notes | Bugs |
||||||||||