當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eHelper::getMemoryUsage方法代碼示例

本文整理匯總了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;
開發者ID:OSUser,項目名稱:e107,代碼行數:31,代碼來源:footer_default.php


注:本文中的eHelper::getMemoryUsage方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。