title: psutil: get cpu of all processes
body: <p>Maybe I'm overlooking something, but I can't figure out how to get <code>current_process.cpu_percent(interval=0.1)</code> for all processes at once without iterating over them. Currently iteration will take <code>process_count * interval</code> seconds to finish. Is there a way around this?</p>
  
  <p>So far I'm doing:</p>
  
  <pre><code>#!/usr/bin/env python2
  import psutil
  
  cpu_count = psutil.cpu_count()
  
  processes_info = []
  for proc in psutil.process_iter():
      try:
          pinfo = proc.as_dict(attrs=['pid', 'username', 'memory_info', 'cpu_percent', 'name'])
  
          current_process = psutil.Process(pid=pinfo['pid'])
  
          pinfo["cpu_info"] = current_process.cpu_percent(interval=0.1)
          processes_info.append(pinfo)
  
      except psutil.NoSuchProcess:
          pass
  
  print processes_info
  </code></pre>
  
  <p>As far as I understand it, I cannot include <code>cpu-percent</code> into the <code>attr</code>-list, since the help states</p>
  
  <blockquote>
    <p>When interval is 0.0 or None compares system CPU times elapsed since last call or module import, returning immediately. That means the first time this is called it will return a meaningless 0.0 value which you are supposed to ignore. </p>
  </blockquote>