title: cpu_get_usage in php?
body: <p>I have created a benchmark class that allows the user to insert for example</p>
  
  <pre><code>$timer-&gt;checkpoint('1');
  </code></pre>
  
  <p>to check out some code for time,memory consumption and such.... and at the end of the code if she/he wants to test it she/he has to insert</p>
  
  <pre><code>$result=$timer-&gt;result();
  </code></pre>
  
  <p>this gives out some data to public function result() like e.g. memory usage (using memory_get_peak_usage) and time consumption (microtime()).</p>
  
  <p>This all works just fine for me. </p>
  
  <p>But how can I use the combination of existing built-in php functions to <strong>get a value that can be considered a CPU consumption</strong>? </p>
  
  <p>It has been quite easy to calculate how much time has been spent on a certain piece of code using the built-in functions, but I've been having trouble thinking of a way how to get the CPU consumption for a certain piece of code.</p>