c++ - Calculating accurate cpu usage per task in assembly -


i've multi-task program written in c++ , want calculate cpu usage each of threads in sub second basis (may 100 ms) may know /proc/stat or didn't have accuracy resolution of time.

i want know there way calculate clock cycles consumed each thread in assembly or c/c++?

starting linux 2.6.12 , glibc 2.4, can use clock_gettime clock of type clock_thread_cputime_id realiable timing information


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -