Commit | Line | Data |
---|---|---|
8168e750 WJ |
1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3 | .\" | |
4 | .\" Redistribution and use in source and binary forms, with or without | |
5 | .\" modification, are permitted provided that the following conditions | |
6 | .\" are met: | |
7 | .\" 1. Redistributions of source code must retain the above copyright | |
8 | .\" notice, this list of conditions and the following disclaimer. | |
9 | .\" 2. Redistributions in binary form must reproduce the above copyright | |
10 | .\" notice, this list of conditions and the following disclaimer in the | |
11 | .\" documentation and/or other materials provided with the distribution. | |
12 | .\" 3. All advertising materials mentioning features or use of this software | |
13 | .\" must display the following acknowledgement: | |
14 | .\" This product includes software developed by the University of | |
15 | .\" California, Berkeley and its contributors. | |
16 | .\" 4. Neither the name of the University nor the names of its contributors | |
17 | .\" may be used to endorse or promote products derived from this software | |
18 | .\" without specific prior written permission. | |
19 | .\" | |
20 | .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
21 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
22 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
23 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
24 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |
25 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | |
26 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | |
27 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | |
28 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | |
29 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | |
30 | .\" SUCH DAMAGE. | |
31 | .\" | |
32 | .\" @(#)times.3 6.4 (Berkeley) 4/19/91 | |
33 | .\" | |
34 | .Dd April 19, 1991 | |
35 | .Dt TIMES 3 | |
36 | .Os BSD 4 | |
37 | .Sh NAME | |
38 | .Nm times | |
39 | .Nd process times | |
40 | .Sh SYNOPSIS | |
41 | .Fd #include <sys/times.h> | |
42 | .Ft clock_t | |
43 | .Fn times "struct tms *tp" | |
44 | .Sh DESCRIPTION | |
45 | .Bf -symbolic | |
46 | This interface is obsoleted by getrusage(2) | |
47 | and gettimeofday(3). | |
48 | .Ef | |
49 | .Pp | |
50 | The | |
51 | .Fn times | |
52 | function returns the value of time in | |
53 | .Dv CLK_TCK Ns 's | |
54 | of a second since | |
55 | 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal | |
56 | Time. | |
57 | .Pp | |
58 | It also fills in the structure pointed to by | |
59 | .Fa tp | |
60 | with time-accounting information. | |
61 | .Pp | |
62 | The | |
63 | .Fa tms | |
64 | structure is defined as follows: | |
65 | .Bd -literal -offset indent | |
66 | typedef struct { | |
67 | clock_t tms_utime; | |
68 | clock_t tms_stime; | |
69 | clock_t tms_cutime; | |
70 | clock_t tms_cstime; | |
71 | } | |
72 | .Ed | |
73 | .Pp | |
74 | The elements of this structure are defined as follows: | |
75 | .Bl -tag -width tms_cutime | |
76 | .It Fa tms_utime | |
77 | The | |
78 | .Tn CPU | |
79 | time charged for the execution of user instructions. | |
80 | .It Fa tms_stime | |
81 | The | |
82 | .Tn CPU | |
83 | time charged for execution by the system on behalf of | |
84 | the process. | |
85 | .It Fa tms_cutime | |
86 | The sum of the | |
87 | .Fa tms_utime s | |
88 | and | |
89 | .Fa tms_cutime s | |
90 | of the child processes. | |
91 | .It Fa tms_cstime | |
92 | The sum of the | |
93 | .Fa tms_stime Ns s | |
94 | and | |
95 | .Fa tms_cstime Ns s | |
96 | of the child processes. | |
97 | .El | |
98 | .Pp | |
99 | All times are in | |
100 | .Dv CLK_TCK Ns 's | |
101 | of a second. | |
102 | .Pp | |
103 | The times of a terminated child process are included in the | |
104 | .Fa tms_cutime | |
105 | and | |
106 | .Fa tms_cstime | |
107 | elements of the parent when one of the | |
108 | .Xr wait 2 | |
109 | functions returns the process ID of the terminated child to the parent. | |
110 | If an error occurs, | |
111 | .Fn times | |
112 | returns the value | |
113 | .Pq (clock_t)\-1 , | |
114 | and sets errno to indicate the error. | |
115 | .Sh ERRORS | |
116 | The | |
117 | .Fn times | |
118 | function | |
119 | may fail and set the global variable | |
120 | .Va errno | |
121 | for any of the errors specified for the library | |
122 | routines | |
123 | .Xr getrusage 2 | |
124 | and | |
125 | .Xr gettimeofday 2 . | |
126 | .Sh SEE ALSO | |
127 | .Xr time 1 , | |
128 | .Xr getrusage 2 , | |
129 | .Xr gettimeofday 2 , | |
130 | .Xr wait 2 | |
131 | .Sh STANDARDS | |
132 | The | |
133 | .Fn times | |
134 | function | |
135 | conforms to | |
136 | .St -p1003.1-88 . |