I have a wxPython app which has many worker threads, idle event cycles, and many other such event handling code which can consume CPU, for now when app is not being interacted with consumes about 8-10% CPU.
Question:
Is there a tool which can tell which part/threads of my app is consuming most CPU? If there are no such generic tools, I am willing to know the approaches you usually take to tackle such scenarios? e.g. disabling part of app, trace etc
Edit: May be my question's language is ambiguous, I do not want to know which function or code block in my code takes up most resources, for that I can use profiler. What I want to know is when I run my app, and I see cpu usage it is 8-10%, now is there a way to know what different parts, threads of my app are using up that 10% cpu? Basically at that instant i want to know which part(s) of code is running?