Also known as UNIX time
command in the Unix operating systems
The time utility shall invoke the utility named by the utility operand with arguments supplied as the argument operands and write a message to standard error that lists timing statistics for the utility. The message shall include the following information: The User CPU time, equivalent to the sum of the tms utime and tms cutime fields returned by the times () function defined in the System Interfaces volume of POSIX.1-2017 for the process in which utility is executed. The System CPU time, equivalent to the sum of the tms stime and tms cstime fields returned by the times () function for the process in which utility is executed. Write the timing output to standard error in the format shown in the STDERR section. Provide a default value for the internationalization variables that are unset or null. (See XBD Internationalization Variables for the precedence of internationalization variables used to determine the values of locale categories.) If set to a non-empty string value, override the values of all the other internationalization variables. Determine the locale that should be used to affect the format and contents of diagnostic and informative messages written to standard error. [XSI) ] ![[Option Start]]( Determine the location of message catalogs for the processing of LC MESSAGES. ![[Option End]]( If the utility utility is invoked, the standard error shall be used to write the timing statistics and may be used to write a diagnostic message if the utility terminates abnormally; otherwise, the standard error shall be used to write diagnostic messages and may also be used to write the timing statistics. where each floating-point number shall be expressed in seconds. The precision used may be less than the default six digits of %f, but shall be sufficiently precise to accommodate the size of the clock tick on the system (for example, if there were 60 clock ticks per second, at least two digits shall follow the radix character). The number of digits following the radix character shall be no less than one, even if this always results in a trailing zero. The implementation may append white space and additional information following the format shown here. The implementation may also prepend a single empty line before the format shown here. The utility specified by utility was found but could not be invoked. The command , env , nice , nohup , time , and xargs utilities have been specified to use exit code 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. Some scripts produce meaningful error messages differentiating the 126 and 127 cases. The distinction between exit codes 126 and 127 is based on KornShell practice that uses 127 when all attempts to exec the utility fail with [ENOENT], and uses 126 when any attempt to exec the utility fails for any other reason. The underlying CPU definitions from the System Interfaces volume of POSIX.1-2017 are vague, so the numeric output could not be compared accurately between systems or even between invocations. The creation of portable benchmark programs was outside the scope this volume of POSIX.1-2017. The default output format has been left unspecified because historical implementations differ greatly in their style of depicting this numeric output. The -p option was invented to provide scripts with a common means of obtaining this information. In the KornShell, time is a shell reserved word that can be used to time an entire pipeline, rather than just a simple command. The POSIX definition has been worded to allow this implementation. Consideration was given
Excerpt from a page describing this subject · 12,475 chars · not written by Vinony
via Wikidata · CC0
via Wikidata sitelinks · CC0
Discovered by embedding cosine similarity (sentence-transformers MiniLM, 384-dim).