Documentation
¶
Overview ¶
Package time implements the POSIX time utility, with the format string extensions of the GNU one.
The real time of the run is measured with the runtime clock around the execution of the utility. The user and system CPU times and the other resource counters come from the runtime execution-usage hook; the averaged memory sizes the hook does not carry, like the shared text and unshared data sizes, are always written as zero, as they are on the systems whose kernels do not fill them in.
When the runtime cannot report the usage counters, every resource specifier but the elapsed time degrades to zero, and the built-in default format degrades to the three POSIX lines of real, user and system time.
The percentage of the CPU is computed from the full durations the runtime carries, rather than from the millisecond-truncated ones of GNU time, so it keeps its precision on very short runs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Prog ¶
Prog is the time core utility.
func (*Prog) Run ¶
Run invokes the utility operand with the argument operands, and writes the timing statistics of the run to the standard error, or to the file the -o option names. The exit status of the utility becomes the exit status of time, and the 127, 126 and 125 statuses of a failed execution are passed along with a diagnostic, without statistics. The context error is returned as-is when the caller's context is done.