Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

time(1) [v7 man page]

TIME(1) 						      General Commands Manual							   TIME(1)

NAME
time - time a command SYNOPSIS
time command DESCRIPTION
The given command is executed; after it is complete, time prints the elapsed time during the command, the time spent in the system, and the time spent in execution of the command. Times are reported in seconds. The execution time can depend on what kind of memory the program happens to land in; the user time in MOS is often half what it is in core. The times are printed on the diagnostic output stream. BUGS
Elapsed time is accurate to the second, while the CPU times are measured to the 60th second. Thus the sum of the CPU times can be up to a second larger than the elapsed time. TIME(1)

Check Out this Related Man Page

time(1) 						      General Commands Manual							   time(1)

NAME
time - Times the execution of a command SYNOPSIS
time [-p] command [argument...] The time command prints the elapsed time during the execution of a command, the time spent in the system, and the time spent in execution of the command on the diagnostic output system. Note The C shell has a built-in version of the time command. If you are using the C shell, and want to guarantee that you are using the command described here, you must specify the full path /usr/bin/time. See the csh(1) reference page for a description of the built-in command. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: time: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
Writes the timing output to standard error. This is the default. OPERANDS
The name of a command to be executed. If command identifies any name specified as a special built in your applicable shell reference page, the results are undefined and unpredictable. The argument to be passed to command. See the appropriate reference pages for these values. This parameter may include flags and arguments expected by command. DESCRIPTION
The time command prints the elapsed time during the execution of a command, the time spent in the system, and the time spent in execution of the command on the diagnostic output system. Time is reported in seconds. The time command (with a different format) is also built into csh. NOTES
When time is used as part of a pipeline, the times reported are unspecified, except when it is the sole command within a grouping command in that pipeline. For example, the commands on the left are unspecified; those on the right report on utilities a and c, respectively. time a | b | c { time a } | b | c a | b | time c a | b | (time c) EXIT STATUS
The time command returns the following exit values if the command could not be invoked: An error occurred in the time command. The command specified by command was found but could not be invoked. The command specified by command could not be found. If the command was successfully invoked, the exit status of time is the exit status of command. EXAMPLES
To measure the time required to run a program, enter: time a.out This runs the program a.out and writes to the standard error output the amount of real, system, and user time that it uses: real 10.5 user 0.3 sys 3.6 To measure the time required by a complex command, enter: time sh -c 'complex-cmmand-line' This runs all of the commands, which may include pipelines, and returns the time information for the entire series of commands. ENVIRONMENT VARIABLES
The following environment variables affect the execution of time: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, overrides the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the for- mat and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MESSAGES. Determines the path used to locate command. SEE ALSO
Commands: csh(1), ksh(1), Bourne shell sh(1b), POSIX shell sh(1p) Functions: times(3) Standards: standards(5) time(1)
Man Page