* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
#if defined(LIBC_SCCS) && !defined(lint)
static char sccsid
[] = "@(#)times.c 5.2 (Berkeley) %G%";
#endif LIBC_SCCS and not lint
#include <sys/resource.h>
* Backwards compatible times.
int tms_utime
; /* user time */
int tms_stime
; /* system time */
int tms_cutime
; /* user time, children */
int tms_cstime
; /* system time, children */
register struct tms
*tmsp
;
if (getrusage(RUSAGE_SELF
, &ru
) < 0)
tmsp
->tms_utime
= scale60(&ru
.ru_utime
);
tmsp
->tms_stime
= scale60(&ru
.ru_stime
);
if (getrusage(RUSAGE_CHILDREN
, &ru
) < 0)
tmsp
->tms_cutime
= scale60(&ru
.ru_utime
);
tmsp
->tms_cstime
= scale60(&ru
.ru_stime
);
register struct timeval
*tvp
;
return (tvp
->tv_sec
* 60 + tvp
->tv_usec
/ 16667);