times.3ucb revision c10c16dec587a0662068f6e2991c29ed3a9db943
te
Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
times 3UCB "30 Oct 2007" "SunOS 5.11" "SunOS/BSD Compatibility Library Functions"
NAME
times - get process times
SYNOPSIS

/usr/ucb/cc [ flag ... ] file ...
#include <sys/param.h>
#include <sys/types.h>
#include <sys/times.h>

int times(tmsp)
register struct tms *tmsp;
DESCRIPTION

The times() function returns time-accounting information for the current process and for the terminated child processes of the current process. All times are reported in clock ticks. The number of clock ticks per second is defined by the variable CLK_TCK, found in the header <limits.h>.

A structure with the following members is returned by times():

time_t tms_utime; /* user time */
time_t tms_stime; /* system time */ 
time_t tms_cutime; /* user time, children */
time_t tms_cstime; /* system time, children */

The children's times are the sum of the children's process times and their children's times.

RETURN VALUES

Upon successful completion, times() returns 0. Otherwise, it returns -1.

SEE ALSO

time(1), time(2), getrusage(3C), wait(3C)

NOTES

Use of these interfaces should be restricted to only applications written on BSD platforms. Use of these interfaces with any of the system libraries or in multi-threaded applications is unsupported.

The times() function has been superseded by getrusage(3C).