Commit | Line | Data |
---|---|---|
c66d0958 KB |
1 | .\" Copyright (c) 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
43062420 | 3 | .\" |
c66d0958 | 4 | .\" %sccs.include.redist.man% |
43062420 | 5 | .\" |
c66d0958 KB |
6 | .\" @(#)times.3 6.3 (Berkeley) %G% |
7 | .\" | |
8 | .TH TIMES 3 "" | |
43062420 KM |
9 | .UC 4 |
10 | .SH NAME | |
c66d0958 | 11 | times \- process times |
43062420 KM |
12 | .SH SYNOPSIS |
13 | .nf | |
c66d0958 KB |
14 | .ft B |
15 | #include <sys/times.h> | |
16 | ||
17 | clock_t times(struct tms *tp); | |
18 | .ft R | |
43062420 KM |
19 | .fi |
20 | .SH DESCRIPTION | |
80cc0fcb | 21 | .ft B |
c66d0958 | 22 | This interface is obsoleted by getrusage(2) and gettimeofday(3). |
80cc0fcb KM |
23 | .ft R |
24 | .PP | |
c66d0958 KB |
25 | The |
26 | .I times | |
27 | function returns the value of time in CLK_TCK's of a second since | |
28 | 0 hours, 0 minutes, 0 seconds, January 1, 1970, Coordinated Universal | |
29 | Time. | |
43062420 | 30 | .PP |
c66d0958 KB |
31 | It also fills in the structure pointed to by |
32 | .I tp | |
33 | with time-accounting information. | |
43062420 | 34 | .PP |
c66d0958 KB |
35 | The |
36 | .I tms | |
37 | structure is defined as follows: | |
38 | .sp | |
39 | typedef struct { | |
40 | .RS | |
41 | clock_t tms_utime; | |
42 | .br | |
43 | clock_t tms_stime; | |
44 | .br | |
45 | clock_t tms_cutime; | |
46 | .br | |
47 | clock_t tms_cstime; | |
48 | .br | |
49 | .RE | |
50 | } | |
43062420 | 51 | .PP |
c66d0958 KB |
52 | The elements of this structure are defined as follows: |
53 | .TP | |
54 | tms_utime | |
55 | The CPU time charged for the execution of user instructions. | |
56 | .TP | |
57 | tms_stime | |
58 | The CPU time charged for execution by the system on behalf of | |
59 | the process. | |
60 | .TP | |
61 | tms_cutime | |
62 | The sum of the | |
63 | .IR tms_utime s | |
64 | and | |
65 | .IR tms_cutime s | |
66 | of the child processes. | |
67 | .TP | |
68 | tms_cstime | |
69 | The sum of the | |
70 | .IR tms_stime s | |
71 | and | |
72 | .IR tms_cstime s | |
73 | of the child processes. | |
74 | .PP | |
75 | All times are in CLK_TCK's of a second. | |
76 | .PP | |
77 | The times of a terminated child process are included in the | |
78 | .I tms_cutime | |
79 | and | |
80 | .I tms_cstime | |
81 | elements of the parent when one of the | |
82 | .IR wait () | |
83 | functions returns the process ID of the terminated child to the parent | |
84 | (see | |
85 | .IR wait (2)). | |
86 | If an error occurs, | |
87 | .I times | |
88 | returns ((clock_t)-1), and sets errno to indicate the error. | |
89 | .SH ERRORS | |
90 | .I Times | |
91 | may fail and set errno for any of the errors specified for the library | |
92 | routines | |
93 | .IR getrusage (2) | |
94 | and | |
95 | .IR gettimeofday (2). | |
43062420 | 96 | .SH "SEE ALSO" |
c66d0958 KB |
97 | time(1), getrusage(2), gettimeofday(2), wait(2) |
98 | .SH STANDARDS | |
99 | .B Times | |
100 | conforms to POSIX Std 1003.1-1988. |