silnik wrzucony na xampa 3.2.1 niedziala ...
Kod:
1048576) { $Unit = 1048576; $UnitName = 'MB'; } else if($Mem > 1024) { $Unit = 1024; $UnitName = 'KB'; } else { $Unit = 1; $UnitName = 'B'; } return sprintf('%0.4f', ($Mem/$Unit)).' '.$UnitName; } public function breakPoint() { $this->TimeArray[] = $this->getTime(); $this->MemArray[] = $this->humanMemSize(memory_get_usage()); } public function newStart() { $this->StartTime = microtime(true); } public function simpleCountStart($ReturnKey = false, $SetName = '') { $this->SimpleCountArray[] = array('start' => microtime(true), 'startram' => $this->humanMemSize(memory_get_usage()), 'name' => $SetName); $this->CountersStarted += 1; if($ReturnKey) { $GetKeys = array_keys($this->SimpleCountArray); return $GetKeys[(count($GetKeys) - 1)]; } } public function simpleCountStop($ReturnKey = false) { if($this->CountersStarted > 0) { $Temp = $this->SimpleCountArray; krsort($Temp); foreach($Temp as $Key => $Value) { if(empty($Value['result'])) { $this->SimpleCountArray[$Key]['result'] = microtime(true) - $this->SimpleCountArray[$Key]['start']; $this->SimpleCountArray[$Key]['endram'] = $this->humanMemSize(memory_get_usage()); $this->SimpleCountArray[$Key]['assocLevel'] = $this->CountersStarted; if($this->CountersStarted > 1) { $this->SimpleCountArray[$Key]['assoc'] = true; } if($ReturnKey) { $StopedKey = $Key; } break; } } $this->CountersStarted -= 1; if($ReturnKey) { return $StopedKey; } } return false; } public function showSimpleCountSwitch() { if($this->ShowSimpleCount) { $this->ShowSimpleCount = false; } else { $this->ShowSimpleCount = true; } } public function echoTableSwitch() { if($this->echoTable) { $this->echoTable = false; } else { $this->echoTable = true; } } private function getTime() { return (microtime(true) - $this->StartTime); } function __construct() { $this->InitMem = $this->humanMemSize(memory_get_usage()); $this->StartTime = microtime(true); } private function prepareResults() { if($this->echoTable) { $this->breakPoint(); $endKey = count($this->TimeArray) - 1; $Echo = '
'; $Echo .= ''; foreach($this->TimeArray as $key => $val) { $TotalTime += $val; $Echo .= ''; } if(!empty($this->SimpleCountArray[0]['result']) AND $this->ShowSimpleCount) { $Echo .= ''; foreach($this->SimpleCountArray as $Index => $Data) { if(!empty($Data['result'])) { if(empty($PreviousParentID)) { $PreviousParentID[] = $Index; $PreviousAssocLevel = 1; } $Difference = $PreviousAssocLevel - $Data['assocLevel']; if($Difference == -2) { $PreviousParentID[] = $PreviousKey; $PreviousAssocLevel = $this->SimpleCountArray[end($PreviousParentID)]['assocLevel']; } else if($Difference >= 0) { for($i = 0; $i <= $Difference; $i += 1) { array_pop($PreviousParentID); } if(empty($PreviousParentID)) { $PreviousParentID[] = $Index; $PreviousAssocLevel = 1; } else { $PreviousAssocLevel = $this->SimpleCountArray[end($PreviousParentID)]['assocLevel']; } } $PreviousKey = $Index; if($Data['assoc'] == true) { $ThisTime = $this->SimpleCountArray[end($PreviousParentID)]['result']; } else { $ThisTime = $TotalTime; } $Echo .= ''; $Echo .= ''; } } } $Echo .= 'Wyniki pomiarĂłw |
Nazwa pkt. |
Nr. |
Poziom |
Czas wykonywania |
ZuĹźycie pamiÄci |
Init Mem |
#0 |
|
|
'.$this->InitMem.' |
'; if($key != $endKey) { $Echo .= 'BreakPoint |
#'.($key+1).''; } else { $Echo .= 'EndPoint |
#'.($endKey+1).''; } $Echo .= ' |
|
'.sprintf('%0.20f', $val).' s. |
'.$this->MemArray[$key].' |
Proste Pomiary UĹźytkownika |
Pomiar'.(!empty($Data['name']) ? '
['.$Data['name'].']' : '').' |
#'.($Index+1).' |
» '.$Data['assocLevel'].' |
'.sprintf('%0.20f', $Data['result']).' s.
('.sprintf('%0.8f', ($Data['result']/$ThisTime) * 100).'%) |
'.$Data['startram'].' / '.$Data['endram'].' |
'; $this->Result = $Echo; } } public function ReturnResult() { if($this->Result === FALSE) { $this->prepareResults(); } return $this->Result; } public function ReturnTimeArray() { return $this->TimeArray; } public function ReturnSimpleCountArray() { return $this->SimpleCountArray; } } ?>
Fatal error: Class 'phpBench' not found in C:\xampp\htdocs\un\common.php on line 3
taki blad wywala
Zakładki