本文整理汇总了PHP中eHelper::getMemoryUsage方法的典型用法代码示例。如果您正苦于以下问题:PHP eHelper::getMemoryUsage方法的具体用法?PHP eHelper::getMemoryUsage怎么用?PHP eHelper::getMemoryUsage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eHelper
的用法示例。
在下文中一共展示了eHelper::getMemoryUsage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parseheader
//
if (!deftrue('e_IFRAME')) {
parseheader(varset($ph) ? $cust_footer : $FOOTER);
}
$eTimingStop = microtime();
global $eTimingStart;
$clockTime = e107::getSingleton('e107_traffic')->TimeDelta($eTimingStart, $eTimingStop);
$dbPercent = 100.0 * $db_time / $clockTime;
// Format for display or logging
$rendertime = number_format($clockTime, 2);
// Clock time during page render
$db_time = number_format($db_time, 2);
// Clock time in DB render
$dbPercent = number_format($dbPercent, 0);
// DB as percent of clock
$memuse = eHelper::getMemoryUsage();
// Memory at end, in B/KB/MB/GB ;)
$queryCount = $sql->db_QueryCount();
$rinfo = '';
$logLine = '';
if ($pref['log_page_accesses']) {
// Collect the first batch of data to log
$logLine .= "'" . ($now = time()) . "','" . gmstrftime('%y-%m-%d %H:%M:%S', $now) . "','" . e107::getIPHandler()->getIP(FALSE) . "','" . e_PAGE . '?' . e_QUERY . "','" . $rendertime . "','" . $db_time . "','" . $queryCount . "','" . $memuse . "','" . $_SERVER['HTTP_USER_AGENT'] . "','{$_SERVER["REQUEST_METHOD"]}'";
}
if (function_exists('getrusage')) {
$ru = getrusage();
$cpuUTime = $ru['ru_utime.tv_sec'] + $ru['ru_utime.tv_usec'] * 1.0E-6;
$cpuSTime = $ru['ru_stime.tv_sec'] + $ru['ru_stime.tv_usec'] * 1.0E-6;
$cpuUStart = $eTimingStartCPU['ru_utime.tv_sec'] + $eTimingStartCPU['ru_utime.tv_usec'] * 1.0E-6;
$cpuSStart = $eTimingStartCPU['ru_stime.tv_sec'] + $eTimingStartCPU['ru_stime.tv_usec'] * 1.0E-6;
$cpuStart = $cpuUStart + $cpuSStart;