本文整理匯總了PHP中Timer::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP Timer::getInstance方法的具體用法?PHP Timer::getInstance怎麽用?PHP Timer::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Timer
的用法示例。
在下文中一共展示了Timer::getInstance方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor
* Initialize Logger
*
* @access public
*/
public function __construct()
{
if (defined('LOGGER_LEVEL')) {
self::$level = LOGGER_LEVEL;
} else {
self::$level = LOGGER_LEVEL_DEBUG;
}
self::$timer = Timer::getInstance();
}
示例2: define
<?php
define('DIF_VIRTUAL_WEB_ROOT', "/htdocs/");
define('DIF_INDEX_ROOT', dirname(__FILE__) . "/");
define('DIF_WEB_ROOT', realpath(DIF_INDEX_ROOT) . DIF_VIRTUAL_WEB_ROOT);
define('DIF_ROOT', realpath(DIF_WEB_ROOT . "/../dif") . "/");
define('DIF_SYSTEM_ROOT', realpath(DIF_WEB_ROOT . "../data") . "/");
require_once DIF_ROOT . 'utils/Utils.php';
require_once DIF_ROOT . 'utils/Timer.php';
// include external tools
Utils::setIncludePath();
$timer = Timer::getInstance();
require_once DIF_ROOT . "/core/Director.php";
$director = Director::getInstance();
$director->main();
//echo ' Executed in '. $timer->getTime().' seconds';
//echo '<!-- Executed in '. $timer->getTime().' seconds -->';
/*
$cache = Cache::getInstance();
$request = Request::getInstance();
Utils::debug(sprintf("%s : Executed in %s seconds (%s)", $request->getPath(), $timer->getTime(), $cache->isCached() ? 'CACHED' : 'GENERATED'), 'timer.log');
*/