Measuring gross and net cpu usage of pthreads? From one point of the code to another (not average like calling ps)

i can measure gross cpu usage by reading special Pentium registers like for instance using opencv functions cvGetTickCount() and cvGetTickFrequency()

i can measure net cpu usage by all threads (one process) by using clock()

But I don't have currently available functions to measure net cpu usage by one single thread!!