2

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?

RagHaven
  • 131

1 Answers1

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