xref: /openbsd-src/usr.bin/time/time.1 (revision 2b0358df1d88d06ef4139321dd05bd5e05d91eaf)
1.\"	$OpenBSD: time.1,v 1.18 2009/02/08 17:15:10 jmc 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. Neither the name of the University nor the names of its contributors
16.\"    may be used to endorse or promote products derived from this software
17.\"    without specific prior written permission.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29.\" SUCH DAMAGE.
30.\"
31.\"     @(#)time.1	8.1 (Berkeley) 6/6/93
32.\"
33.Dd $Mdocdate: February 8 2009 $
34.Dt TIME 1
35.Os
36.Sh NAME
37.Nm time
38.Nd time command execution
39.Sh SYNOPSIS
40.Nm time
41.Op Fl lp
42.Ar utility
43.Sh DESCRIPTION
44.Nm
45executes and
46times
47.Ar utility .
48After the
49.Ar utility
50finishes,
51.Nm
52writes the total time elapsed,
53the time consumed by system overhead,
54and the time used to execute
55.Ar utility
56to the standard error stream.
57Times are reported in seconds.
58.Pp
59The options are as follows:
60.Bl -tag -width Ds
61.It Fl l
62The contents of the
63.Em rusage
64structure are printed.
65.It Fl p
66The output is formatted as specified by
67.St -p1003.2-92 .
68.El
69.Pp
70The
71.Nm
72utility shall exit with one of the following values:
73.Pp
74.Bl -tag -width indent -compact
75.It 1\-125
76An error occurred in the
77.Nm
78utility.
79.It 126
80The
81.Ar utility
82was found but could not be invoked.
83.It 127
84The
85.Ar utility
86could not be found.
87.El
88.Pp
89Otherwise, the exit status of
90.Nm
91shall be that of
92.Ar utility .
93.Sh FILES
94.Bl -tag -width /usr/include/sys/resource.h -compact
95.It Pa /usr/include/sys/resource.h
96.El
97.Sh SEE ALSO
98.Xr csh 1 ,
99.Xr ksh 1 ,
100.Xr getrusage 2
101.Sh STANDARDS
102The
103.Nm
104utility is compliant with the
105.St -p1003.1-2008
106specification.
107.Pp
108The flag
109.Op Fl l
110is an extension to that specification.
111.Pp
112.Nm
113also exists as a built-in to
114.Xr csh 1
115and
116.Xr ksh 1 ,
117though with a different syntax.
118.Sh HISTORY
119A
120.Nm
121command appeared in
122.At v3 .
123.Sh BUGS
124The granularity of seconds on microprocessors is crude and
125can result in times being reported for CPU usage which are too large by
126a second.
127