Penguin
Annotated edit history of times(2) version 1, including all changes. View license author blame.
Rev Author # Line
1 perry 1 TIMES
2 !!!TIMES
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 RETURN VALUE
7 NOTE
8 CONFORMING TO
9 HISTORICAL NOTES
10 SEE ALSO
11 ----
12 !!NAME
13
14
15 times - get process times
16 !!SYNOPSIS
17
18
19 __#include __
20
21
22 __clock_t times(struct tms
23 *__''buf''__);__
24 !!DESCRIPTION
25
26
27 The __times__() function stores the current process times
28 in the __struct tms__ that ''buf'' points to. The
29 ''struct tms'' is as defined in
30 '''':
31
32
33 struct tms {
34 clock_t tms_utime; /* user time */
35 clock_t tms_stime; /* system time */
36 clock_t tms_cutime; /* user time of children */
37 clock_t tms_cstime; /* system time of children */
38 };
39 The ''tms_utime'' field contains the CPU time spent executing instructions of the calling process. The ''tms_stime'' field contains the CPU time spent in the system while executing tasks on behalf of the calling process. The ''tms_cutime'' field contains the sum of the ''tms_utime'' and ''tms_cutime'' values for all waited-for terminated children. The ''tms_cstime'' field contains the sum of the ''tms_stime'' and ''tms_cstime'' values for all waited-for terminated children.
40
41
42 Times for terminated children (and their descendants) is
43 added in at the moment wait(2) or __waitpid(2)__
44 returns their process ID. In particular, times of
45 grandchildren that the children did not wait for are never
46 seen.
47
48
49 All times reported are in clock ticks.
50 !!RETURN VALUE
51
52
53 The function __times__ returns the number of clock ticks
54 that have elapsed since an arbitrary point in the past. For
55 Linux this point is the moment the system was booted. This
56 return value may overflow the possible range of type
57 clock_t. On error, (clock_t) -1 is returned, and
58 ''errno'' is set appropriately.
59 !!NOTE
60
61
62 The number of clock ticks per second can be obtained
63 using
64
65
66 sysconf(_SC_CLK_TCK);
67
68
69 In POSIX-1996 the symbol CLK_TCK (defined in
70 '''') is mentioned as obsolescent. It is
71 obsolete now.
72
73
74 Note that clock(3) returns values of type clock_t
75 that are not measured in clock ticks but in
76 CLOCKS_PER_SEC.
77 !!CONFORMING TO
78
79
80 SVr4, SVID, POSIX, X/OPEN, BSD 4.3
81 !!HISTORICAL NOTES
82
83
84 SVr1-3 returns __long__ and the struct members are of
85 type __time_t__ although they store clock ticks, not
86 seconds since the epoch. V7 used __long__ for the struct
87 members, because it had no type __time_t__
88 yet.
89
90
91 On older systems the number of clock ticks per second is
92 given by the variable HZ.
93 !!SEE ALSO
94
95
96 time(1), getrusage(2), wait(2),
97 clock(3), sysconf(3)
98 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.