How can I get a thread’s cpu time from the thread itself in Mac OS X ? For linux, what I do is getrusage(RUSAGE_THREAD, &ru) but this solution isn’t available for Mac OS X.
I came across this question but I don’t know how to adapt it for my purpose (I’m not familiar with Mac OS X’s internals. I am not even sure pthread thread == mach thread).
This is what I ended up with:
[…]
I get very different results that what i get with
getrusage(RUSAGE_THREAD, &ru)under Linux. So I’m not sure this is the right way.