OpenBSD manual page server

Manual Page Search Parameters

CLOCK_GETCPUCLOCKID(3) Library Functions Manual CLOCK_GETCPUCLOCKID(3)

clock_getcpuclockidget a clock measuring process CPU time

#include <time.h>

int
clock_getcpuclockid(pid_t pid, clockid_t *clock_id);

The () 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:

[]
pid is neither zero nor the PID of the calling process.

clock_gettime(2), pthread_getcpuclockid(3)

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-7.6