I have a function that I port from Linux to MacOSX that uses clock_gettime with CLOCK_THREAD_CPUTIME_ID to measure the time spent on the process. I found this code on the Internet that would give me the equivalent of CLOCK_REALTIME:
#ifdef __MACH__
But I cannot find an easy way to get clock_gettime (CLOCK_THREAD_CPUTIME_ID, ts); Does anyone know a good solution for this?
source share