Bash - time (Execution Time Measurement)

Bash Liste Des Attaques Ovh

About

time is a bash reserved word to print the time statistics (elapsed (wall-clock) time and user and system time. The use of time as a reserved word permits the timing of:

An external time command cannot time these easily.

Configuration

TIMEFORMAT

The value of the TIMEFORMAT shell variable is used as a format string specifying how the timing information for pipelines should be displayed.

The % character introduces an escape sequence that is expanded to a time value or other information. The escape sequences and their meanings are as follows; the braces denote optional portions.

  • %% A literal %.
  • %[p][l]R The elapsed time in seconds.
  • %[p][l]U The number of CPU seconds spent in user mode.
  • %[p][l]S The number of CPU seconds spent in system mode.
  • %P The CPU percentage, computed as (%U + %S) / %R.

where:

  • p (default 3) is a digit specifying the precision, the number of fractional digits after a decimal point. A value of 0 causes no decimal point or fraction to be output. At most three places after the decimal point may be specified; values of p greater than 3 are changed to 3.
  • l specifies a longer format, including minutes, of the form MMmSS.FFs. The value of p determines whether or not the fraction is included.
    • If this variable is not set, bash acts as if it had the value $'\nreal\t%3lR\nuser\t%3lU\nsys%3lS'.
    • If the value is null, no timing information is displayed.

A trailing newline is added when the format string is displayed.





Discover More
Bash Liste Des Attaques Ovh
Bash - (Builtin|Intern|System|Reserved|Shell) variable name

Reserved variable name are named that have a special meaning for the bash shell. PS1 defines the shell's command-line prompt. HOME defines the home directory for a user. PATH defines a list...
Bash Liste Des Attaques Ovh
Bash - Pipeline

This article talks the syntax of a Shell Pipeline in Bash All command(s) in a pipeline are executed: in parallel. and started in a subshell (meaning that the environment is not passed along the...



Share this page:
Follow us:
Task Runner