当前位置: 首页>>代码示例>>PHP>>正文


PHP PHP_Timer::timeSinceStartOfRequest方法代码示例

本文整理汇总了PHP中PHP_Timer::timeSinceStartOfRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP PHP_Timer::timeSinceStartOfRequest方法的具体用法?PHP PHP_Timer::timeSinceStartOfRequest怎么用?PHP PHP_Timer::timeSinceStartOfRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PHP_Timer的用法示例。


在下文中一共展示了PHP_Timer::timeSinceStartOfRequest方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

<hr>
<small>

    <?php 
if (isset($hasControllerActionTime)) {
    ?>
        <div>Controller Action Execution Time: <?php 
    echo PHP_Timer::secondsToTimeString(PHP_Timer::stop());
    ?>
</div>
    <?php 
}
?>

    <div>Execution Time: <?php 
echo PHP_Timer::timeSinceStartOfRequest();
?>
</div>

    <?php 
if (isset($bootstrapTime)) {
    ?>
        <div>Application Bootstrap Time: <?php 
    echo $bootstrapTime;
    ?>
</div>
    <?php 
}
?>

    <?php 
开发者ID:view-components,项目名称:testing-helpers,代码行数:31,代码来源:timing.php

示例2: testTimeSinceStartOfRequest

 /**
  * @covers PHP_Timer::timeSinceStartOfRequest
  */
 public function testTimeSinceStartOfRequest()
 {
     $this->assertStringMatchesFormat('%i %s', PHP_Timer::timeSinceStartOfRequest());
 }
开发者ID:nbalonso,项目名称:MunkiFace,代码行数:7,代码来源:TimerTest.php

示例3: printFooter

 /**
  * @param  PHPUnit_Framework_TestResult  $result
  */
 protected function printFooter(PHPUnit_Framework_TestResult $result)
 {
     $this->write(sprintf("\nFinished in %s\n", PHP_Timer::timeSinceStartOfRequest()));
     $resultsCount = count($result);
     $footer = sprintf("%d test%s, %d assertion%s", $resultsCount, $resultsCount == 1 ? '' : 's', $this->numAssertions, $this->numAssertions == 1 ? '' : 's');
     if ($result->wasSuccessful() && $result->allCompletelyImplemented() && $result->noneSkipped()) {
         $this->write($this->green($footer));
     } else {
         if ((!$result->allCompletelyImplemented() || !$result->noneSkipped()) && $result->wasSuccessful()) {
             $footer .= sprintf("%s%s", $this->getCountString($result->notImplementedCount(), 'incomplete'), $this->getCountString($result->skippedCount(), 'skipped'));
             $this->write($this->yellow($footer));
         } else {
             $footer .= sprintf("%s%s%s%s", $this->getCountString($result->failureCount(), 'failures'), $this->getCountString($result->errorCount(), 'errors'), $this->getCountString($result->notImplementedCount(), 'incomplete'), $this->getCountString($result->skippedCount(), 'skipped'));
             $footer = preg_replace('/,$/', '', $footer);
             $this->write($this->red($footer));
         }
     }
     // if ( ! $this->verbose &&
     //   $result->deprecatedFeaturesCount() > 0 )
     // {
     //   $message = sprintf(
     //     "Warning: Deprecated PHPUnit features are being used %s times!\n".
     //     "Use --verbose for more information.\n",
     //     $result->deprecatedFeaturesCount()
     //   );
     //
     //   if ($this->colors) {
     //     $message = "\x1b[37;41m\x1b[2K" . $message .
     //       "\x1b[0m";
     //   }
     //
     //   $this->write("\n" . $message);
     // }
     $this->writeNewLine();
 }
开发者ID:michaelachrisco,项目名称:phpunit-progress,代码行数:38,代码来源:ResultPrinter.php

示例4: printFooter

 /**
  * @param  PHPUnit_Framework_TestResult  $result
  */
 protected function printFooter(PHPUnit_Framework_TestResult $result)
 {
     $this->write(sprintf("\nFinished in %s\n", PHP_Timer::timeSinceStartOfRequest()));
     $resultsCount = count($result);
     $footer = sprintf("%d test%s, %d assertion%s", $resultsCount, $resultsCount == 1 ? '' : 's', $this->numAssertions, $this->numAssertions == 1 ? '' : 's');
     // backwards/forwards compatibility hack for naming fix from phpunit 3.7.11
     // @see https://github.com/sebastianbergmann/phpunit/issues/762
     $allCompletelyImplemented = method_exists($result, 'allCompletelyImplemented') ? 'allCompletelyImplemented' : 'allCompletlyImplemented';
     if ($result->wasSuccessful() && $result->{$allCompletelyImplemented}() && $result->noneSkipped()) {
         $this->write($this->green($footer));
     } else {
         if ((!$result->{$allCompletelyImplemented}() || !$result->noneSkipped()) && $result->wasSuccessful()) {
             $footer .= sprintf("%s%s", $this->getCountString($result->notImplementedCount(), 'incomplete'), $this->getCountString($result->skippedCount(), 'skipped'));
             $this->write($this->yellow($footer));
         } else {
             $footer .= sprintf("%s%s%s%s", $this->getCountString($result->failureCount(), 'failures'), $this->getCountString($result->errorCount(), 'errors'), $this->getCountString($result->notImplementedCount(), 'incomplete'), $this->getCountString($result->skippedCount(), 'skipped'));
             $footer = preg_replace('/,$/', '', $footer);
             $this->write($this->red($footer));
         }
     }
     if (method_exists($result, 'deprecatedFeaturesCount')) {
         if (!$this->verbose && $result->deprecatedFeaturesCount() > 0) {
             $message = sprintf("Warning: Deprecated PHPUnit features are being used %s times!\n" . "Use --verbose for more information.\n", $result->deprecatedFeaturesCount());
             if ($this->colors) {
                 $message = "[37;41m[2K" . $message . "[0m";
             }
             $this->write("\n" . $message);
         }
     }
     $this->writeNewLine();
 }
开发者ID:joskfg,项目名称:guard-phpunit2,代码行数:34,代码来源:ResultPrinter.php

示例5: PDO

            $pdo = new PDO($dsn, $dbItem['username'], $dbItem['password']);
        } catch (\PDOException $e) {
            throw new \Exception('connect to db failed: [' . $dsn . ']');
        }
        $sql = $query->getSql();
        dump($sql);
        $statement = $pdo->query($sql);
        $resultSet = $statement->fetchAll(PDO::FETCH_ASSOC);
        return array_map(function (array $data) {
            return $data['snsid'];
        }, $resultSet);
    }
}
$options = getopt('', ['concurrency:', 'date:', 'gv:']);
$concurrency = isset($options['concurrency']) ? (int) $options['concurrency'] : 100;
$gameVersion = isset($options['gv']) ? $options['gv'] : 'tw';
appendLog('game version: ' . $gameVersion . ', concurrency: ' . $concurrency);
$base = __DIR__ . '/../../../farm-server-conf/';
assert(is_dir($base));
$esHost = '52.19.73.190';
$esPort = 9200;
$esClient = new Client(['hosts' => [sprintf('http://%s:%d/', $esHost, $esPort)]]);
//$docUpdater = new DocumentUpdater($esClient, $gameVersion);
$docUpdater = new NonBlockingDocUpdater($concurrency);
$updater = new UserStatusUpdater($gameVersion);
dump($options);
$query = array_key_exists('date', $options) ? new AllDeAuthorizedUserQuery($options['date']) : new DeAuthorizedUserQuery();
$resultSet = $updater->run(\Environment\PlatformFactory::make($gameVersion), $query, $docUpdater);
dump($resultSet);
dump('Run time: ' . PHP_Timer::timeSinceStartOfRequest());
dump(sprintf('Memory: %4.2fMb', memory_get_peak_usage(true) / 1048576));
开发者ID:jiangyu7408,项目名称:notification,代码行数:31,代码来源:disableUser.php


注:本文中的PHP_Timer::timeSinceStartOfRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。