Project

General

Profile

Bug #20568 ยป 0011267.patch

Administrator Admin, 2009-06-04 15:06

View differences:

t3lib/class.t3lib_timetrack.php (Arbeitskopie)
3 => '<img src="'.TYPO3_mainDir.'gfx/icon_fatalerror.gif" width="18" height="16" align="absmiddle" alt="" />'
);
$this->starttime = 0;
$this->starttime = $this->mtime();
$this->starttime = $this->getMilliseconds();
}
/**
......
'level' => $this->tsStackLevel,
'tsStack' => $this->tsStack,
'value' => $value,
'starttime' => microtime(),
'starttime' => microtime(true),
'stackPointer' => $this->tsStackPointer
);
}
......
*/
function pull($content='') {
$k = end($this->currentHashPointer);
$this->tsStackLog[$k]['endtime'] = microtime();
$this->tsStackLog[$k]['endtime'] = microtime(true);
$this->tsStackLog[$k]['content'] = $content;
$this->tsStackLevel--;
......
* Returns the current time in milliseconds
*
* @return integer
* @deprecated since TYPO3 4.3 - use getDifferenceToStarttime() instead
*/
function mtime() {
return $this->convertMicrotime(microtime())-$this->starttime;
function mtime() {
return $this->getDifferenceToStarttime();
}
/**
......
*
* @param string PHP microtime string
* @return integer
* @deprecated since TYPO3 4.3 - use getMilliseconds() instead that expects microtime as float instead of a string
*/
function convertMicrotime($microtime) {
function convertMicrotime($microtime) {
t3lib_div::logDeprecatedFunction();
$parts = explode(' ',$microtime);
return round(($parts[0]+$parts[1])*1000);
}
/**
* Gets a microtime value as milliseconds value.
*
* @param float $microtime: The microtime value - if not set the current time is used
* @return integer The microtime value as milliseconds value
*/
public function getMilliseconds($microtime = NULL) {
if (!isset($microtime)) {
$microtime = microtime(true);
}
return round($microtime * 1000);
}
/**
* Gets the difference between a given microtime value and the starting time as milliseconds.
*
* @param float $microtime: The microtime value - if not set the current time is used
* @return integer The difference between a given microtime value and starting time as milliseconds
*/
public function getDifferenceToStarttime($microtime = NULL) {
return ($this->getMilliseconds($microtime) - $this->starttime);
}
......
/*******************************************
*
* Printing the parsing time information (for Admin Panel)
......
function printTSlog() {
// Calculate times and keys for the tsStackLog
foreach ($this->tsStackLog as $uniqueId => &$data) {
$data['endtime'] = $this->convertMicrotime($data['endtime']) - $this->starttime;
$data['starttime'] = $this->convertMicrotime($data['starttime']) - $this->starttime;
$data['endtime'] = $this->getDifferenceToStarttime($data['endtime']);
$data['starttime'] = $this->getDifferenceToStarttime($data['starttime']);
$data['deltatime'] = $data['endtime'] - $data['starttime'];
$data['key'] = implode($data['stackPointer'] ? '.' : '/', end($data['tsStack']));
}
t3lib/class.t3lib_div.php (Arbeitskopie)
}
/**
* milliseconds
* microtime recalculated to t3lib_div::milliseconds(1/1000 sec)
* Usage: 20
* Gets the unixtime as milliseconds.
*
* @return integer
* @return integer The unixtime as milliseconds
*/
public static function milliseconds() {
$p=explode(' ',microtime());
return round(($p[0]+$p[1])*1000);
public static function milliseconds() {
return round(microtime(true) * 1000);
}
/**
typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie)
*/
function setParseTime() {
// Compensates for the time consumed with Back end user initialization.
$this->scriptParseTime = $GLOBALS['TT']->convertMicrotime($GLOBALS['TYPO3_MISC']['microtime_end'])
- $GLOBALS['TT']->convertMicrotime($GLOBALS['TYPO3_MISC']['microtime_start'])
- ($GLOBALS['TT']->convertMicrotime($GLOBALS['TYPO3_MISC']['microtime_BE_USER_end'])-$GLOBALS['TT']->convertMicrotime($GLOBALS['TYPO3_MISC']['microtime_BE_USER_start']));
$this->scriptParseTime = $GLOBALS['TT']->getMilliseconds($GLOBALS['TYPO3_MISC']['microtime_end'])
- $GLOBALS['TT']->getMilliseconds($GLOBALS['TYPO3_MISC']['microtime_start'])
- ($GLOBALS['TT']->getMilliseconds($GLOBALS['TYPO3_MISC']['microtime_BE_USER_end']) - $GLOBALS['TT']->getMilliseconds($GLOBALS['TYPO3_MISC']['microtime_BE_USER_start']));
}
/**
typo3/sysext/cms/tslib/index_ts.php (Arbeitskopie)
// ******************
// Constants defined
// ******************
$TYPO3_MISC['microtime_start'] = microtime();
$TYPO3_MISC['microtime_start'] = microtime(true);
define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
define('TYPO3_MODE','FE');
......
// *********
$BE_USER='';
if ($_COOKIE['be_typo_user']) { // If the backend cookie is set, we proceed and checks if a backend user is logged in.
$TYPO3_MISC['microtime_BE_USER_start'] = microtime();
$TYPO3_MISC['microtime_BE_USER_start'] = microtime(true);
$TT->push('Back End user initialized','');
// the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
......
$TSFE->beUserLogin=0;
}
$TT->pull();
$TYPO3_MISC['microtime_BE_USER_end'] = microtime();
$TYPO3_MISC['microtime_BE_USER_end'] = microtime(true);
} elseif ($TSFE->ADMCMD_preview_BEUSER_uid) {
// the value this->formfield_status is set to empty in order to disable login-attempts to the backend account through this script
......
// ***********
// Statistics
// ***********
$TYPO3_MISC['microtime_end'] = microtime();
$TYPO3_MISC['microtime_end'] = microtime(true);
$TSFE->setParseTime();
if ($TSFE->isOutputting() && ($TSFE->TYPO3_CONF_VARS['FE']['debug'] || $TSFE->config['config']['debug'])) {
echo '
typo3/sysext/install/mod/class.tx_install.php (Arbeitskopie)
$this->messageFunc_nl2br=0;
$parseStart = microtime();
$parseStart = t3lib_div::milliseconds();
$imageProc = t3lib_div::makeInstance('t3lib_stdGraphic');
$imageProc->init();
$imageProc->tempPath = $this->typo3temp_path;
......
");
}
$parseStop = microtime();
$parseMS = t3lib_div::convertMicrotime($parseStop)-t3lib_div::convertMicrotime($parseStart);
$parseMS = t3lib_div::milliseconds() - $parseStart;
$this->message('Info','Parsetime',$parseMS.' ms');
}
$this->output($this->outputWrapper($this->printAll()));
    (1-1/1)