CLOCK_GETCPUCLOCKID(3) | Library Functions Manual | CLOCK_GETCPUCLOCKID(3) |
clock_getcpuclockid
—
get a clock measuring process CPU time
#include
<time.h>
int
clock_getcpuclockid
(pid_t
pid, clockid_t
*clock_id);
The
clock_getcpuclockid
()
function allows the calling process to get a clockid_t
value that measures the time spent by CPUs running in user or kernel mode on
behalf of the process specified by pid. If
pid is zero, then a clock for the calling process will
be returned.
If successful, clock_getcpuclockid
() will
return zero. Otherwise an error number will be returned to indicate the
error.
clock_getcpuclockid
() will fail if:
EPERM
]The clock_getcpuclockid
() function
conforms to IEEE Std 1003.1-2008
(“POSIX.1”).
The clock_getcpuclockid
() function first
appeared in IEEE Std 1003.1d-1999 (“POSIX.1d”) and has been
available since OpenBSD 5.4.
January 15, 2015 | OpenBSD-current |