xref: /openbsd-src/usr.bin/time/time.1 (revision b2ea75c1b17e1a9a339660e7ed45cd24946b230e)
1.\"	$OpenBSD: time.1,v 1.10 2000/03/11 21:40:04 aaron Exp $
2.\"	$NetBSD: time.1,v 1.5 1994/12/08 09:36:57 jtc Exp $
3.\"
4.\" Copyright (c) 1980, 1991, 1993
5.\"	The Regents of the University of California.  All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\" 3. All advertising materials mentioning features or use of this software
16.\"    must display the following acknowledgement:
17.\"	This product includes software developed by the University of
18.\"	California, Berkeley and its contributors.
19.\" 4. Neither the name of the University nor the names of its contributors
20.\"    may be used to endorse or promote products derived from this software
21.\"    without specific prior written permission.
22.\"
23.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33.\" SUCH DAMAGE.
34.\"
35.\"     @(#)time.1	8.1 (Berkeley) 6/6/93
36.\"
37.Dd June 6, 1993
38.Dt TIME 1
39.Os
40.Sh NAME
41.Nm time
42.Nd time command execution
43.Sh SYNOPSIS
44.Nm time
45.Op Fl lp
46.Ar utility
47.Sh DESCRIPTION
48.Nm
49executes and
50times
51.Ar utility .
52After the
53.Ar utility
54finishes,
55.Nm
56writes the total time elapsed,
57the time consumed by system overhead,
58and the time used to execute
59.Ar utility
60to the standard error stream.
61Times are reported in seconds.
62.Pp
63The options are as follows:
64.Bl -tag -width Ds
65.It Fl l
66The contents of the
67.Em rusage
68structure are printed.
69.It Fl p
70The output is formatted as specified by
71.St -p1003.2-92 .
72.El
73.Pp
74.Xr csh 1
75has its own and syntactically different built-in version of
76.Nm time .
77The utility described here
78is available as
79.Pa /usr/bin/time
80to
81.Xr csh
82users.
83.Pp
84The
85.Nm
86utility shall exit with one of the following values:
87.Pp
88.Bl -tag -width indent -compact
89.It 1\-125
90An error occurred in the
91.Nm
92utility.
93.It 126
94The
95.Ar utility
96was found but could not be invoked.
97.It 127
98The
99.Ar utility
100could not be found.
101.El
102.Pp
103Otherwise, the exit status of
104.Nm
105shall be that of
106.Ar utility .
107.Sh FILES
108.Bl -tag -width /usr/include/sys/resource.h -compact
109.It Pa /usr/include/sys/resource.h
110.El
111.Sh SEE ALSO
112.Xr csh 1 ,
113.Xr getrusage 2
114.Sh STANDARDS
115The
116.Nm
117utility conforms to
118.St -p1003.2-92 .
119.Sh HISTORY
120A
121.Nm
122command appeared in
123.At v6 .
124.Sh BUGS
125The granularity of seconds on microprocessors is crude and
126can result in times being reported for CPU usage which are too large by
127a second.
128