title: psutil: Measuring the cpu usage of a specific process
body: <p>Im trying to measure the cpu usage of a process tree.</p>
  
  <p>Currently getting the cpu_usage of a process (without children) will do, but I'm getting weird results.</p>
  
  <pre><code>import psutil
  p = psutil.Process(PID)
  p.cpu_percent
  </code></pre>
  
  <p>gives me back <code>float</code>><code>100</code>, how is that even possible?</p>
  
  <p>btw <code>PID</code> is the pid of something simple as</p>
  
  <pre><code>def foo():
      i = 0
      while True:
          i += 1
  </code></pre>
  
  <p>which according to task manager its cpu usage is around <code>12%</code></p>
  
  <p>I want to get an output of <code>12.5</code> or something like that.</p>