times command (displays the amount of CPU time used by the shell)
- Organization of this page
Format
times
Description
This command outputs to the standard output the amount of CPU time used by the shell and by processes launched from the shell. The following information is displayed:
-
User CPU time (in seconds) used by the shell
-
System CPU time (in seconds) used by the shell
-
Total user CPU time (in seconds) used by processes launched from the shell
-
Total system CPU time (in seconds) used by processes launched from the shell
The output format of the times command is shown in the following table:
Output format# |
Meaning |
---|---|
Shell: CPU-time user CPU-time system |
CPU time used by the shell is output in the order user CPU time, system CPU time. |
Kids: CPU-time user CPU-time system |
CPU time used by processes launched from the shell is output in the order user CPU time, system CPU time. |
Note that if an option is specified, it is ignored and processing of the command continues unaffected.
Return code
Return code |
Meaning |
---|---|
0 |
Normal termination |
Notes
-
In Windows, the CPU time of child processes does not include the CPU time of grandchild processes.
-
Even if the command syntax of this regular built-in command is invalid, it does not exit the shell that is executing the command.
Usage example
-
Display the CPU time of the shell and the process launched from the shell (ps command).
Contents of the job definition script
ps > /dev/null times
Contents of the STDOUT file of the execution job
******** JOB SCOPE STDOUT ******** Shell: 0.00s user 0.01s system Kids: 0.01s user 0.10s system