CLOCK_THREAD_CPUTIME_ID 与 pthread_getcpuclockid(pthread_self(),..) 相同吗?
Is CLOCK_THREAD_CPUTIME_ID the same as pthread_getcpuclockid(pthread_self(),..)?
在使用 Posix clock_gettime() 获取每线程 CPU 时间方面:使用从 pthread_getcpuclockid(pthread_self(),..) 或使用 CLOCK_THREAD_CPUTIME_ID?
根据 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.
在使用 Posix clock_gettime() 获取每线程 CPU 时间方面:使用从 pthread_getcpuclockid(pthread_self(),..) 或使用 CLOCK_THREAD_CPUTIME_ID?
根据 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.