src/Web2All/Manager/Main.class.php
public function debugLogCPU($message='')
  {
    // get resource usage
    $dat = getrusage();
    $message.='[u:'.substr(($dat["ru_utime.tv_sec"]*1e6+$dat["ru_utime.tv_usec"])-$this->startUserCPU,0,-3).'ms / s:'.substr(($dat["ru_stime.tv_sec"]*1e6+$dat["ru_stime.tv_usec"])-$this->startSystemCPU,0,-3).'ms]';
    $this->debugLog($message);
  }
public function debugLogCPU($message='')
  {
    // get resource usage
    $dat = getrusage();
    $message.='[u:'.substr(($dat["ru_utime.tv_sec"]*1e6+$dat["ru_utime.tv_usec"])-$this->startUserCPU,0,-3).'ms / s:'.substr(($dat["ru_stime.tv_sec"]*1e6+$dat["ru_stime.tv_usec"])-$this->startSystemCPU,0,-3).'ms]';
    $this->debugLog($message);
  }
public function debugLogCPU ( $ message = '' ) { // get resource usage
 $ dat = getrusage ( ) ; $ message .= '[u:' . substr ( ( $ dat [ "ru_utime.tv_sec" ] * 1e6 + $ dat [ "ru_utime.tv_usec" ] ) - $ this -> startUserCPU , 0 , - 3 ) . 'ms / s:' . substr ( ( $ dat [ "ru_stime.tv_sec" ] * 1e6 + $ dat [ "ru_stime.tv_usec" ] ) - $ this -> startSystemCPU , 0 , - 3 ) . 'ms]' ; $ this -> debugLog ( $ message ) ; }
Debug log the CPU used by the script

Please note its only updated every 10ms.

output: <user message>[u: <user time>ms / s:<system time>ms]

@param string $message  [optional message to prepend]
Debug log the CPU used by the script