Is there any way to measure execution time of thread under macos? I know that there is getrusage function, but it is supposed only to measure process time (Under linux there is extension to measure thread time, but unfortunately I work under MacOs). I need to measure time of thread (the sum of processed time in user and kernel spaces). The exact analogue is GetThreadTimes under Windows (https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getthreadtimes)