So I want to get the cpu time used by a thread given its ID. getrusage
is not applicable here as getrusage(RUSAGE_THREAD, &r_usage);
returns the resources used by the thread that calls it, here I want to get resources of a thread other than the one I am in.
Asked
Active
Viewed 396 times
2
-
Any reason why http://stackoverflow.com/questions/2150291/how-do-i-measure-a-time-interval-in-c won't work for you? – Michael Dorgan Mar 27 '17 at 17:31
-
2because I need CPU time not wall clock time – Dev2017 Mar 27 '17 at 17:32