示例#1
0
	/**
	 * Get the breakdown of recorded events and their time into the profiler operation.
	 * 
	 * @return string
	 */
	public function getEventTimesFormatted(){
		$out = '';
		foreach ($this->getEvents() as $t) {
			$in = round($t['timetotal'], 5) * 1000;
			$dcm = I18NLoader::GetLocaleConv('decimal_point');

			if ($in == 0){
				$time = '0000' . $dcm . '00 ms';
			}
			else{
				$parts = explode($dcm, $in);
				$whole = str_pad($parts[0], 4, 0, STR_PAD_LEFT);
				$dec   = (isset($parts[1])) ? str_pad($parts[1], 2, 0, STR_PAD_RIGHT) : '00';
				$time = $whole . $dcm . $dec . ' ms';
			}

			$mem = '[mem: ' . \Core\Filestore\format_size($t['memory']) . '] ';

			$event = $t['event'];

			$out .= "[$time] $mem- $event" . "\n";
		}

		return $out;
	}