CLOCK_THREAD_CPUTIME_ID与pthread_getcpuclockid(pthread_self(),..)相同吗?

时间:2015-01-14 23:57:20

标签: cpu-time

在使用Posix clock_gettime()获取每线程CPU时间方面:使用从pthread_getcpuclockid(pthread_self(),..)获取的时钟ID或使用CLOCK_THREAD_CPUTIME_ID之间有什么区别吗?

1 个答案:

答案 0 :(得分:1)

根据man page

NOTES

   When thread refers to the calling thread, this function returns an
   identifier that refers to the same clock manipulated by
   clock_gettime(2) and clock_settime(2) when given the clock ID
   CLOCK_THREAD_CPUTIME_ID.