Subj : Re: nptl threads execution time To : comp.programming.threads From : loic-dev Date : Tue Apr 12 2005 09:57 am Bonjour Daniel, > For control and feedback scheduling purpose I need to measure > the execution time of threads, i.e. the accumulated time spent > between the thread resume and suspension instants > (thus I think that only the scheduler can know that) > > It seems that it is not a standard feature of posix threads? > Did somebody already made that? > > I'm using a fedora core 3 system, nptl lib, 2.6.10 kernel patched with > high res. timers. Perhaps I don't understand your question correctly, but wouldn't the function clock_gettime() with a CLOCK_THREAD_CPUTIME_ID clock do it? This function measures the time a thread has been scheduled on a processor. This quite new function, standardized by SUSv3, is available on FC3. You need to link against -lrt (real-time extension library). Regards, Loic. .