本文整理汇总了PHP中dm::getStartTime方法的典型用法代码示例。如果您正苦于以下问题:PHP dm::getStartTime方法的具体用法?PHP dm::getStartTime怎么用?PHP dm::getStartTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dm
的用法示例。
在下文中一共展示了dm::getStartTime方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
public function configure(array $data)
{
$isXhr = $data['context']->getRequest()->isXmlHttpRequest();
$uri = $this->cleanUri(dmArray::get($data['server'], 'PATH_INFO', $data['server']['REQUEST_URI']));
$milliseconds = (microtime(true) - dm::getStartTime()) * 1000;
$this->data = array('time' => (string) $data['server']['REQUEST_TIME'], 'uri' => dmString::truncate($uri, 500), 'code' => (string) $data['context']->getResponse()->getStatusCode(), 'app' => (string) sfConfig::get('sf_app'), 'env' => (string) sfConfig::get('sf_environment'), 'ip' => (string) $data['server']['REMOTE_ADDR'], 'user_id' => (string) $data['context']->getUser()->getUserId(), 'user_agent' => dmString::truncate($isXhr ? '' : isset($data['server']['HTTP_USER_AGENT']) ? $data['server']['HTTP_USER_AGENT'] : '', 500), 'xhr' => (int) $isXhr, 'mem' => (string) memory_get_peak_usage(true), 'timer' => (string) sprintf('%.0f', $milliseconds), 'cache' => sfConfig::get('dm_internal_page_cached'));
}
示例2: getPerformanceInfos
public static function getPerformanceInfos()
{
return array(
'usage' => memory_get_usage(true) / (1024*1024),
'peak' => memory_get_peak_usage(true) / (1024*1024),
'max' => ini_get('memory_limit'),
'time' => round(1000*(microtime(true) - dm::getStartTime()))
);
}
示例3: getTimeFromStart
/**
* How many time elapsed since request ?
*/
public static function getTimeFromStart()
{
return sprintf('%.0f', (microtime(true) - dm::getStartTime()) * 1000);
}