Forwarded from blog: http://www.51testing.com /? Uid-390472-action-viewspace-itemid-232903
Time
Command is used to print the execution time of a command or program.
Time
The time, system time, and time used in the execution of a command in seconds
The command execution time is printed in a standard error.
Usage: Time
[-P
] Command
[Argument
...]
For example, if you want to know the time it takes to list the home Folder: time ls/home and the time it takes to copy the file to a folder: time CP/home/***/h/home/***/documents:
Time./helloworld. Sh
Output Format:
Real * m *. *** s
User
* M *. *** s
Sys
* M *. *** s
Note:
Time The command result consists of three lines: Real, user, and SYS. Here we use real values, which indicate the time consumed from the beginning of the program to the end of the program execution, including the CPU usage. . CPU is divided into user and SYS. The user value indicates the time used by the program and the Child routines in the library it calls. Sys is a system call directly or indirectly called by a program. Execution time. On a single processor, the difference between the real value and the overall CPU usage, that is, the real-(User + sys) is the sum of all the factors that delay program execution. On SMP, this value is similar to real * number_of_processors-(User + sys ). These factors include:
- Io operations for transferring program text and Data
- Obtain the IO operations in which the program actually uses the memory
- ByOthers
CPU used by the program
- ByOperating System
CPU usage
|
|