I have a source code that is using some threads.
I want to see how many percent cpu and percent memory are used each threads.
So I used "htop" command. (I am using ubuntu.)
There are "PID" columns which is Process/thread ID.
I googled how to get thread id.
- https://en.cppreference.com/w/cpp/thread/thread/id/hash
- How to convert std::thread::id to string in c++?
But, somehow the thread ids I got from source code are not matched with PID values, one of htop command's output.
Any better idea or help would be great, thank you.