Annotation of src/usr.bin/time/time.1, Revision 1.13
1.13 ! jmc 1: .\" $OpenBSD: time.1,v 1.12 2003/06/03 02:56:18 millert Exp $
1.1 deraadt 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.
1.12 millert 15: .\" 3. Neither the name of the University nor the names of its contributors
1.1 deraadt 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 June 6, 1993
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
1.7 aaron 44: .Nm
1.1 deraadt 45: executes and
46: times
47: .Ar utility .
48: After the
49: .Ar utility
50: finishes,
1.7 aaron 51: .Nm
1.1 deraadt 52: writes the total time elapsed,
53: the time consumed by system overhead,
1.7 aaron 54: and the time used to execute
55: .Ar utility
1.1 deraadt 56: to the standard error stream.
57: Times are reported in seconds.
58: .Pp
1.8 aaron 59: The options are as follows:
1.1 deraadt 60: .Bl -tag -width Ds
61: .It Fl l
62: The contents of the
63: .Em rusage
64: structure are printed.
65: .It Fl p
66: The output is formatted as specified by
67: .St -p1003.2-92 .
68: .El
69: .Pp
1.13 ! jmc 70: The
! 71: .Nm
! 72: utility exists as a built-in to most shells,
! 73: although they may be syntactically different.
! 74: The utility described here is available as
! 75: .Pa /usr/bin/time .
1.10 aaron 76: .Pp
1.1 deraadt 77: The
1.7 aaron 78: .Nm
1.1 deraadt 79: utility shall exit with one of the following values:
1.10 aaron 80: .Pp
81: .Bl -tag -width indent -compact
1.7 aaron 82: .It 1\-125
83: An error occurred in the
84: .Nm
1.1 deraadt 85: utility.
86: .It 126
1.7 aaron 87: The
1.1 deraadt 88: .Ar utility
89: was found but could not be invoked.
90: .It 127
1.7 aaron 91: The
1.1 deraadt 92: .Ar utility
93: could not be found.
94: .El
95: .Pp
1.7 aaron 96: Otherwise, the exit status of
97: .Nm
98: shall be that of
1.1 deraadt 99: .Ar utility .
100: .Sh FILES
1.3 deraadt 101: .Bl -tag -width /usr/include/sys/resource.h -compact
102: .It Pa /usr/include/sys/resource.h
1.1 deraadt 103: .El
1.9 aaron 104: .Sh SEE ALSO
105: .Xr csh 1 ,
1.13 ! jmc 106: .Xr sh 1 ,
1.9 aaron 107: .Xr getrusage 2
1.1 deraadt 108: .Sh STANDARDS
109: The
110: .Nm
1.7 aaron 111: utility conforms to
1.1 deraadt 112: .St -p1003.2-92 .
1.9 aaron 113: .Sh HISTORY
114: A
115: .Nm
116: command appeared in
1.11 mickey 117: .At v3 .
1.1 deraadt 118: .Sh BUGS
119: The granularity of seconds on microprocessors is crude and
120: can result in times being reported for CPU usage which are too large by
121: a second.