Time Command in Shell

Source: Internet
Author: User

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




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.