Calculation of thread execution time


I just wanted to know how to go about calculating the thread execution time in QNX.Currently we read “/proc” file to read thread execution times.But we wanted to know if there is a cleaner alternative to calculate the thread execution time.I know of an API to calculate execution time of a process but could not find anything for calculating the thread execution time of a thread.


You can use clock_gettime and ClockId

uint64_t threadtime;
int thread_clock_id = ClockId( pid, tid );
ClockTime( thread_clock_id, NULL, &threadtime );