【发布时间】:2015-01-14 23:57:20
【问题描述】:
在使用Posix clock_gettime() 获取每个线程的CPU 时间方面:使用从pthread_getcpuclockid(pthread_self(),..) 获得的时钟ID 和使用CLOCK_THREAD_CPUTIME_ID 有什么区别?
【问题讨论】:
标签: cpu-time
在使用Posix clock_gettime() 获取每个线程的CPU 时间方面:使用从pthread_getcpuclockid(pthread_self(),..) 获得的时钟ID 和使用CLOCK_THREAD_CPUTIME_ID 有什么区别?
【问题讨论】:
标签: cpu-time
根据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.
【讨论】: