keyword

Bash time

Measure a pipeline and print timing information on stderr; return pipeline status.

Formal Syntax & Structure

bash syntaxbash
time [-p] pipeline

Return Value

exit status

Measure a pipeline and print timing information on stderr; return pipeline status.

Working Example

Example Snippetbash
TIMEFORMAT='measurement complete'time { printf 'payload\n'; }printf 'status=%s\n' "$?"
Bash Reference