This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: CLOCK_PROCESS_CPUTIME_ID question
- From: Mark Brown <bmark at us dot ibm dot com>
- To: Henry Baldursson <henry dot baldursson at gmail dot com>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Fri, 11 Feb 2005 14:43:00 -0600
- Subject: Re: CLOCK_PROCESS_CPUTIME_ID question
- Reply-to: bmark at us dot ibm dot com
> The function of the clock represented by CLOCK_PROCESS_CPUTIME_ID
> seems sort of vague to me. According to version 3 of the single unix
> specification:
>
> "When this value of the type clockid_t is used in a clock() or
> timer*() function
> call, it is interpreted as the identifier of the CPU-time clock
> associated with
> the process making the function call."
>
> Does that merely mean the clock gets created at process creation time
> and thus reflects the seconds elapsing since the program started, or
> does it also mean it gets adjusted to reflect the time the CPU spends
> on the running process, ala times(2)'s tms_stime?
Have you read the appropriate definitions for CPU-time, as described
two paragaphs above the one you quoted?
"CPU-time clocks measure execution or CPU time, which is defined in the
Base Definitions volume of IEEE Std 1003.1-2001, Section 3.117, CPU Time
(Execution Time). The mechanism used to measure execution time is
described in the Base Definitions volume of 2061 IEEE Std 1003.1-2001,
Section 4.9, Measurement of Execution Time."
-------------------
Mark Brown/Austin/IBM
bmark@us.ibm.com