本文整理汇总了PHP中Timer::tick方法的典型用法代码示例。如果您正苦于以下问题:PHP Timer::tick方法的具体用法?PHP Timer::tick怎么用?PHP Timer::tick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Timer
的用法示例。
在下文中一共展示了Timer::tick方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
<?php
$THISPATH = dirname(dirname(__FILE__)) . '/';
require_once $THISPATH . 'lib/Timer.php';
Timer::start();
Timer::tick('started');
require_once '_include.php';
#Timer::tick('Include complete');
$config = SimpleSAML_Configuration::getInstance('foodle');
$fullURI = $_SERVER['PATH_INFO'];
$script = $_SERVER['SCRIPT_NAME'];
$path = substr($fullURI, strlen($script) + 1, strlen($fullURI) - strlen($script) - 1);
$parameters = explode('/', $path);
$availableLanguages = array('nb', 'en', 'sv');
$availableLanguages = json_decode(file_get_contents($THISPATH . 'dictionaries/languages.json'), true);
// print_r( $availableLanguages); exit;
try {
$action = array_shift($parameters);
switch ($action) {
case '':
$page = new Pages_PageFront($config, $parameters);
$page->show();
break;
/*
* API used by JS, and possibly others...
*/
/*
* API used by JS, and possibly others...
*/
case 'api':
if (count($parameters) < 1) {
示例2: show
function show()
{
$this->template->data['foodleid'] = $this->foodle->identifier;
$this->template->data['user'] = $this->user;
if ($this->user !== null) {
// $this->template->data['userid'] = $this->user->userid;
$this->template->data['userToken'] = $this->user->getToken();
}
$this->template->data['title'] = 'Foodle :: ' . $this->foodle->name;
$this->template->data['foodle'] = $this->foodle;
$this->template->data['optimize'] = $this->config->getValue('optimize', false);
$this->template->data['gmapsAPI'] = $this->config->getValue('gmapsAPI');
$this->template->data['authenticated'] = $this->auth->isAuth();
$this->template->data['loginurl'] = $this->auth->getLoginURL();
$this->template->data['logouturl'] = $this->auth->getLogoutURL('/');
$this->template->data['url'] = FoodleUtils::getUrl() . 'foodle/' . $this->foodle->identifier;
$this->template->data['bread'] = array(array('href' => '/' . $this->config->getValue('baseurlpath'), 'title' => 'bc_frontpage'), array('href' => '/foodle/' . $this->foodle->identifier, 'title' => $this->foodle->name));
Timer::tick('Presenting page');
$this->template->data['timer'] = Timer::getList();
$this->template->show();
}
示例3: test_percent_calcuations
public function test_percent_calcuations()
{
$timer = new Timer();
$timer->set_total_items(100);
$timer->tick();
$timer->tick();
$timer->tick();
$timer->tick();
$timer->tick();
$this->assertEquals(5, $timer->percent_complete());
}