Return the clock ID of the CPU-time clock from a specified process
#include <sys/types.h> #include <time.h> extern int clock_getcpuclockid( pid_t pid, clockid_t* clock_id );
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The clock_getcpuclockid() function returns the clock ID of the CPU-time clock of the process specified by pid. If the process described by pid exists and the calling process has permission, the clock ID of this clock is stored in clock_id.
If pid is zero, the clock ID of the CPU-time clock of the process marking the call is returned in clock_id.
A process always has permission to obtain the CPU-time clock ID of another process.
The supported clock IDs include:
While the processor isn't in a power-saving mode, CLOCK_SOFTTIME behaves the same as CLOCK_REALTIME.
Zero for success, or an error value.
POSIX 1003.1 CPT
clock_getres(), clock_gettime(), ClockId(), clock_settime(), pthread_getcpuclockid(), timer_create()
Clocks, Timers, and Getting a Kick Every So Often chapter of Getting Started with QNX Neutrino