Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

csh(1)

time(1)

Name

time − time a command

Syntax

time command
/bin/time command

Description

The time command lets the specified command execute and then outputs the amount of elapsed real time, the time spent in the operating system, and the time spent in execution of the command.  Times are reported in seconds and are written to standard error.

If you are using any shell except the C shell, csh(,), you can give the time command as shown on the first line of the Syntax section.  If you are using the C shell, you must use the time command’s full pathname as shown on the second line of the Syntax section.  If you do not use the full pathname, csh will execute its own built-in time command that supplies additional information and uses a different output format.

The time command can be used to cause a command to be timed no matter how much CPU time it takes.  For example:

% /bin/time cp /etc/rc /usr/bill/rc
        0.1 real         0.0 user         0.0 sys
% /bin/time nroff sample1 > sample1.nroff
        3.6 real         2.4 user         1.2 sys

This example indicates that the cp command used negligible amounts of user (user) and system time (sys), and had an elapsed time (real) of 1/10 second (0.1).  The nroff command used 2.4 seconds of user time and 1.2 seconds of system time, and required 3.6 seconds of elapsed time.

Restrictions

Times are measured to an accuracy of 1/10 second.  Thus, the sum of the user and system times can be larger than the elapsed time. 

See Also

csh(1)

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026