Annotation of src/usr.bin/time/time.1, Revision 1.20
1.20 ! jmc 1: .\" $OpenBSD: time.1,v 1.19 2009/07/14 17:24:08 sobrado 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: .\"
1.20 ! jmc 33: .Dd $Mdocdate: July 14 2009 $
1.1 deraadt 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
1.19 sobrado 43: .Op Ar argument ...
1.1 deraadt 44: .Sh DESCRIPTION
1.7 aaron 45: .Nm
1.19 sobrado 46: executes and times
47: .Ar utility
48: with optional
49: .Ar arguments .
1.1 deraadt 50: After the
51: .Ar utility
52: finishes,
1.7 aaron 53: .Nm
1.1 deraadt 54: writes the total time elapsed,
55: the time consumed by system overhead,
1.7 aaron 56: and the time used to execute
57: .Ar utility
1.1 deraadt 58: to the standard error stream.
59: Times are reported in seconds.
60: .Pp
1.8 aaron 61: The options are as follows:
1.1 deraadt 62: .Bl -tag -width Ds
63: .It Fl l
64: The contents of the
65: .Em rusage
66: structure are printed.
67: .It Fl p
68: The output is formatted as specified by
69: .St -p1003.2-92 .
70: .El
1.20 ! jmc 71: .Sh FILES
! 72: .Bl -tag -width /usr/include/sys/resource.h -compact
! 73: .It Pa /usr/include/sys/resource.h
! 74: .El
! 75: .Sh EXIT STATUS
1.1 deraadt 76: The
1.7 aaron 77: .Nm
1.20 ! jmc 78: utility exits with one of the following values:
1.10 aaron 79: .Pp
80: .Bl -tag -width indent -compact
1.7 aaron 81: .It 1\-125
82: An error occurred in the
83: .Nm
1.1 deraadt 84: utility.
85: .It 126
1.7 aaron 86: The
1.1 deraadt 87: .Ar utility
88: was found but could not be invoked.
89: .It 127
1.7 aaron 90: The
1.1 deraadt 91: .Ar utility
92: could not be found.
93: .El
94: .Pp
1.7 aaron 95: Otherwise, the exit status of
96: .Nm
97: shall be that of
1.1 deraadt 98: .Ar utility .
1.9 aaron 99: .Sh SEE ALSO
100: .Xr csh 1 ,
1.16 jmc 101: .Xr ksh 1 ,
1.9 aaron 102: .Xr getrusage 2
1.1 deraadt 103: .Sh STANDARDS
104: The
105: .Nm
1.14 jmc 106: utility is compliant with the
1.18 jmc 107: .St -p1003.1-2008
1.14 jmc 108: specification.
109: .Pp
110: The flag
111: .Op Fl l
112: is an extension to that specification.
1.17 jmc 113: .Pp
114: .Nm
115: also exists as a built-in to
116: .Xr csh 1
117: and
118: .Xr ksh 1 ,
119: though with a different syntax.
1.9 aaron 120: .Sh HISTORY
121: A
122: .Nm
123: command appeared in
1.11 mickey 124: .At v3 .
1.1 deraadt 125: .Sh BUGS
126: The granularity of seconds on microprocessors is crude and
127: can result in times being reported for CPU usage which are too large by
128: a second.