The time command reports these times by default:
- Real: This is the wall clock time-the time from start to finish of the command. This is the elapsed time including time slices used by other processes and the time the process spends when blocked (for example, time spent waiting for I/O to complete).
- User: This is the amount of CPU time spent in user-mode code (outside the kernel) within the process. This is the CPU time used to execute the process. Other processes, and the time these processes spend when blocked do not count toward this figure.
- Sys: This is the amount of CPU time spent in the kernel within the process; the CPU time spent in system calls within the kernel, as opposed to the library code, which runs in the user space. Like user time, this is only the CPU time used by the process. Refer to the following table for a brief description of the kernel mode (also known as supervisor mode) and the system call mechanism.
Many details regarding a process can be reported by the time command. These include exit status, number of signals received, and number of context switches made. Each parameter can be displayed when a suitable format string is supplied to the -f option.
The following table shows some of the interesting parameters:
|
Parameter
|
Description
|
|
%C |
This shows the name and command-line arguments of the command being timed. |
|
%D |
This shows the average size of the process's unshared data area, in kilobytes. |
|
%E |
This shows the elapsed real (wall clock) time used by the process in [hours:] minutes:seconds. |
|
%x |
This shows the exit status of the command. |
|
%k |
This shows the number of signals delivered to the process. |
|
%W |
This shows the number of times the process was swapped out of the main memory. |
|
%Z |
This shows the system's page size in bytes. This is a per-system constant, but varies between systems. |
|
%P |
This shows the percentage of the CPU that this job got. This is just user + system times divided by the total running time. It also prints a percentage sign. |
|
%K |
This shows the average total (data + stack + text) memory usage of the process, in Kilobytes. |
|
%w |
This shows the number of times that the program was context-switched voluntarily, for instance, while waiting for an I/O operation to complete. |
|
%c |
This shows the number of times the process was context-switched involuntarily (because the time slice expired). |