Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
times(2)		      System Calls Manual		      times(2)

NAME
       times - get process and child process times

SYNOPSIS
       #include	<sys/times.h>
       #include	<limits.h>

       clock_t times(struct tms	*buffer);

MT-LEVEL
       Async-Signal-Safe

DESCRIPTION
       times() fills the tms structure pointed to by buffer with time-account-
       ing information.	 The tms structure, defined in <sys/times.h>, contains
       the following members:

		   clock_t    tms_utime;
		   clock_t    tms_stime;
		   clock_t    tms_cutime;
		   clock_t    tms_cstime;

       This  information comes from the	calling	process	and each of its	termi-
       nated child processes for which it has executed a  wait	routine.   All
       times are reported in clock ticks.  The specific	value for a clock tick
       is defined by the variable CLK_TCK, found in the	header <limits.h>.

       tms_utime is the	CPU time used while executing instructions in the user
       space of	the calling process.

       tms_stime  is  the CPU time used	by the system on behalf	of the calling
       process.

       tms_cutime is the sum of	the tms_utime and the tms_cutime of the	 child
       processes.

       tms_cstime  is the sum of the tms_stime and the tms_cstime of the child
       processes.

RETURN VALUES
       Upon successful completion, times() returns the elapsed real  time,  in
       clock  ticks,  from an arbitrary	point in the past (for example,	system
       start-up	time).	This point does	not  change  from  one	invocation  of
       times()	to  another.   If times() fails, a value of -1 is returned and
       errno is	set to indicate	the error.

ERRORS
       times() fails if:

       EFAULT	     buffer points to an illegal address.

SEE ALSO
       time(1),	timex(1), exec(2), fork(2), time(2), wait(2), waitid(2), wait-
       pid(2)

				  29 Jul 1991			      times(2)

NAME | SYNOPSIS | MT-LEVEL | DESCRIPTION | RETURN VALUES | ERRORS | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=times&sektion=2&manpath=SunOS+5.5.1>

home | help