Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ times(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exec(S)

fork(S)

gethz(S)

sysconf(S)

time(S)

wait(S)


 times(S)                       6 January 1993                       times(S)


 Name

    times - get process and child process times

 Syntax


    cc ... -lc


    #include <sys/types.h>
    #include <sys/times.h>

    clock_t times (buffer)
    struct tms *buffer;


 Description

    The times system call fills the structure pointed to by buffer with
    time-accounting information.  The following are the contents of this
    structure:

       struct  tms {
               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 ter-
    minated child processes for which it has executed a wait.  All times are
    reported in clock ticks.  The number of clock ticks per second is a
    system-dependent parameter, which is returned by sysconf(SCCLKTCK).

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

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

    tmscutime is the sum of the tmsutimes and tmscutimes of the child pro-
    cesses.

    tmscstime is the sum of the tmsstimes and tmscstimes of the child pro-
    cesses.

 Diagnostics


    [EFAULT]   The times system call fails if buffer points to an illegal
               address.

 Return value

    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 -1 is returned and errno is set to indicate
    the error.  The return value may overflow the possible range of type
    clockt.

 See also

    exec(S), fork(S), gethz(S), sysconf(S), time(S), wait(S)

 Standards conformance

    times is conformant with:
    AT&T SVID Issue 2;
    X/Open Portability Guide, Issue 3, 1989;
    IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C
    Language] (ISO/IEC 9945-1);
    and NIST FIPS 151-1.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026