*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->HP-UX 11i man pages -> times (2)              


 times(2)                                                           times(2)

 NAME    [Toc]    [Back]
      times - get process and child process times

 SYNOPSIS    [Toc]    [Back]
      #include <sys/times.h>

      clock_t times(struct tms *buffer);

 DESCRIPTION    [Toc]    [Back]
      times() fills the structure pointed to by buffer with time-accounting
      information.  The structure defined in <sys/times.h> is as follows:

           struct tms {
               clock_t     tms_utime;      /* user time */
               clock_t     tms_stime;      /* system time */"
               clock_t     tms_cutime;     /* user time, children */
               clock_t     tms_cstime;     /* system time, children */

      This information comes from the calling process and each of its
      terminated child processes for which it has executed a wait(),
      wait3(), or waitpid().  The times are in units of 1/CLK_TCK seconds,
      where CLK_TCK is processor dependent The value of CLK_TCK can be
      queried using the sysconf() function (see sysconf(2)).

      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

      tms_cutime is the sum of the tms_utimes and tms_cutimes of the child

      tms_cstime is the sum of the tms_stimes and tms_cstimes of the child

 RETURN VALUE    [Toc]    [Back]
      Upon successful completion, times() returns the elapsed real time, in
      units of 1/CLK_TCK of a second, since an arbitrary point in the past
      (such as system start-up time).  This point does not change from one
      invocation of times() to another.  If times() fails, -1 is returned
      and errno is set to indicate the error.

    Remarks    [Toc]    [Back]
      times() has a granularity of one tick. Processes which run less than
      one tick may not register any value.

 ERRORS    [Toc]    [Back]
      [EFAULT]       times() fails if buffer points to an illegal address.
                     The reliable detection of this error is implementation

 Hewlett-Packard Company            - 1 -   HP-UX 11i Version 2: August 2003

 times(2)                                                           times(2)


 SEE ALSO    [Toc]    [Back]
      time(1), gettimeofday(2), exec(2), fork(2), sysconf(2), time(2),

 WARNINGS    [Toc]    [Back]
      Not all CPU time expended by system processes on behalf of a user
      process is counted in the system CPU time for that process.

      times(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1

 Hewlett-Packard Company            - 2 -   HP-UX 11i Version 2: August 2003
[ Back ]
 Similar pages
Name OS Title
pthread_atfork Tru64 Declares fork handler routines to be called when the calling thread's process forks a child process
pxfwait IRIX Obtains information about a calling process' child process
times FreeBSD process times
times Linux get process times
times OpenBSD process times
pxftimes IRIX Gets process times
times NetBSD process times
clone Linux create a child process
fork Linux create a child process
pxfwifstopped IRIX Determines if a child process has stopped
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service