multithreading - c++ thread running time -


i want know whether can calculate running time each thread. implement multithread program in c++ using pthread. know, each thread compete cpu. can use clock() function calculate actual number of cpu clocks each thread consumes?

my program looks like:

class thread () { start(); run(); computing(); }; 

start() start multiple threads. each thread run computing function something. question how can calculate running time of each thread computing function

no, cannot use clock. processor switch thread between start , computing calls calculate time of several threads. need use tick counter local 1 thread.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -