title: How do I get the total CPU usage of an application from /proc/pid/stat?
body: <p>I was wondering how to calculate the total CPU usage of a process.</p>
  
  <p>If I do <code>cat /proc/<em>pid</em>/stat</code>, I think the relevant fields are (<a href="https://web.archive.org/web/20130302063336/http://www.lindevdoc.org/wiki//proc/pid/stat">taken from lindevdoc.org</a>):</p>
  
  <ol start="14">
    <li>CPU time spent in user code, measured in jiffies</li>
    <li>CPU time spent in kernel code, measured in jiffies</li>
    <li>CPU time spent in user code, including time from children</li>
    <li>CPU time spent in kernel code, including time from children</li>
  </ol>
  
  <p>So is the total time spend the sum of fields 14 to 17?</p>