1 .\" Copyright (c) 1980 Regents of the University of California.
2 .\" All rights reserved. The Berkeley software License Agreement
3 .\" specifies the terms and conditions for redistribution.
5 .\" @(#)times.3c 6.1 (Berkeley) 5/9/85
7 .TH TIMES 2 "May 9, 1985"
10 times \- get process times
14 #include <sys/types.h>
15 #include <sys/times.h>
18 int times(struct tms *\fIbuffer\fP)
22 returns time-accounting information
23 for the current process
24 and for the terminated child processes
25 of the current process.
26 All times are in system clock ticks.
28 This is the structure returned by
35 clock_t tms_utime; /* user time for this process */
36 clock_t tms_stime; /* system time for this process */
37 clock_t tms_cutime; /* children's user time */
38 clock_t tms_cstime; /* children's system time */
43 The user time is the number of clock ticks used by a process on
44 its own computations. The system time is the number of clock ticks
45 spent inside the kernel on behalf of a process. This does not
46 include time spent waiting for I/O to happen, only actual CPU
49 The children times are the sum
50 of the children's process times and
51 their children's times.
54 returns the number of system clock ticks since boot time on success,
55 otherwise \-1 with the error code stored into the
58 Since \-1 is also a valid return value upon success, one should clear
60 before calling this function, and if \-1 is returned,
61 check its value again afterwards.
63 The following error code may be set in
67 The address specified by the
69 parameter is not in a valid part of the process address space.