Subj : Re: Per thread cpu-usage on Linux To : comp.programming.threads From : Christian Panten Date : Wed Feb 16 2005 03:03 pm David Schwartz wrote: >> 1. Does anyone know how I can calculate the cpu-time of single thread? >> Reading the cpu time from /proc/... is not a satisfactory solution for >> me. > > Why? That's the solution on Linux. Timing a lot of relatively small functions causes a too big overhead, when one has to parse /proc/self/tasks//stat each time. One is interested in the 15th column of this file. The entries do not have fixed lengths such that one has to scan the whole file. Greets, Christian .