This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CLOCK_PROCESS_CPUTIME_ID question


>  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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]