Example #1
0
 public function __construct($profileConfig)
 {
     if (isset($profileConfig['visible']) && $profileConfig['visible']) {
         $this->visible = true;
     }
     parent::__construct($profileConfig);
 }
Example #2
0
 public function profileOut($functionname)
 {
     $item = end($this->mWorkStack);
     parent::profileOut($functionname);
     if (!$item) {
         $this->trace .= "Profiling error: {$functionname}\n";
     } else {
         list($ofname, , $ortime) = $item;
         if ($functionname == 'close') {
             $message = "Profile section ended by close(): {$ofname}";
             $functionname = $ofname;
             $this->trace .= $message . "\n";
         } elseif ($ofname != $functionname) {
             $this->trace .= "Profiling error: in({$ofname}), out({$functionname})";
         }
         $elapsedreal = $this->getTime() - $ortime;
         $this->trace .= sprintf("%03.6f %6.1f", $elapsedreal, $this->memoryDiff()) . str_repeat(" ", count($this->mWorkStack) + 1) . " < " . $functionname . "\n";
     }
 }