I am trying to conduct some experiments for determining what the CPU utilization of my process is. I am familiar with the top
and ps
commands. Which would be a better solution for getting the average CPU utilization of my process throughout the entire time? From this question it seems like ps would be the best way. Would using top periodically to record stats and averaging the results be more precise?
Asked
Active
Viewed 1,661 times
2
1 Answers
0
It sounds like the gprof
might be what you are looking for. It'll help with debugging to figure out how much time is spent in a function.
You might also want to check out this stack exchange answer: How does βtopβ calculate CPU usage?

SailorCire
- 2,503
-
I'm not looking to profile my app. I just want to show what the overall avg CPU utilization for the process is on running it for an hour β RagHaven Dec 02 '14 at 16:46
-
1@AndroidDev93 I think the stack exchange answer is what you're looking for then. Just have a separate program\script constantly read from /proc β SailorCire Dec 02 '14 at 16:48