本文整理汇总了PHP中benchmarktime函数的典型用法代码示例。如果您正苦于以下问题:PHP benchmarktime函数的具体用法?PHP benchmarktime怎么用?PHP benchmarktime使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了benchmarktime函数的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: parse
function parse($thisfile, $thisext = 'html')
{
$thiszm1 = benchmarktime();
$this->benchmark['all']++;
$file_unique = FALSE;
$thisext = '.' . $thisext;
if (file_exists($this->dir . $thisfile . $thisext)) {
$file_unique = $this->dir . $thisfile . $thisext;
} elseif (file_exists($this->altdir . $thisfile . $thisext)) {
$file_unique = $this->altdir . $thisfile . $thisext;
}
if ($file_unique == FALSE) {
$this->benchmark['error']++;
$this->benchmark['detail'][] = array('time' => 0, 'file' => $thisfile . $thisext);
return '<!-- File does not exist: ' . $this->dir . $thisfile . $thisext . ' and ' . $this->altdir . $thisfile . $thisext . ' -->';
}
extract($GLOBALS, EXTR_SKIP);
extract($this->vars);
$this->benchmark['ok']++;
ob_start();
include $file_unique;
$this->contents = ob_get_contents();
ob_end_clean();
$this->sent[] = $thisfile . $thisext;
$this->vars = array();
$thiszm2 = benchmarktime();
$this->benchmark['time'] += $thiszm2 - $thiszm1;
$this->benchmark['detail'][] = array('time' => substr($thiszm2 - $thiszm1, 0, 7), 'file' => $file_unique);
return $this->contents;
}
示例2: foot
function foot()
{
global $config, $benchmark, $db;
$benchmark = benchmarktime() - $benchmark;
?>
<br style="line-height: 8px;" />
<div class="stext center">[Load Time: <?php
echo round($benchmark, 5);
?>
] [Queries: <?php
echo $db->benchmark('queries');
?>
]</div>
<div id="copyright">
<strong><a href="http://www.viscacha.org" target="_blank">Viscacha <?php
echo $config['version'];
?>
</a></strong><br />
Copyright © 2004-2006, MaMo Net
<?php
echo iif($config['pccron'] == 1, '<img src="cron.php" width="0" height="0" alt="" />');
?>
</div>
</body>
</html>
<?php
}
示例3: parseSmileys
function parseSmileys($text, $type = 'html')
{
$thiszm1 = benchmarktime();
$this->cache_smileys();
if ($type != 'plain') {
foreach ($this->smileys as $smiley) {
$text = str_replace(' ' . $smiley['search'], ' <img src="' . $smiley['replace'] . '" border="0" alt="' . $smiley['desc'] . '" />', $text);
}
}
$thiszm2 = benchmarktime();
$this->benchmark['smileys'] += $thiszm2 - $thiszm1;
return $text;
}
示例4: job_benchmark_end
function job_benchmark_end($start)
{
$duration = benchmarktime() - $start;
$duration = round($duration, 5);
return $duration;
}
示例5: t2
function t2($start = null)
{
if ($start === null) {
$start = SCRIPT_START_TIME;
}
$duration = benchmarktime() - $start;
$duration = round($duration, 5);
return $duration;
}
示例6: error_reporting
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
error_reporting(E_ALL);
DEFINE('SCRIPTNAME', 'admin');
include "data/config.inc.php";
include "admin/data/config.inc.php";
if (empty($config['cryptkey']) || empty($config['database']) || empty($config['dbsystem'])) {
trigger_error('Viscacha is currently not installed. How to install Viscacha is described in the file "_docs/readme.txt"!', E_USER_ERROR);
}
if (empty($config['dbpw']) || empty($config['dbuser'])) {
trigger_error('You have specified database authentification data that is not safe. Please change your database user and the database password!', E_USER_ERROR);
}
include "admin/lib/function.viscacha_backend.php";
$benchmark = benchmarktime();
$job = $gpc->get('job', str);
$slog = new slog();
$my = $slog->logged();
$my->p = $slog->Permissions();
if (!isset($my->settings['admin_interface'])) {
$my->settings['admin_interface'] = $admconfig['nav_interface'];
}
($code = $plugins->load('admin_start')) ? eval($code) : null;
if ($my->p['admin'] == 1) {
if ($action == "frames") {
include 'admin/frames.php';
} elseif ($action == 'index') {
include 'admin/start.php';
} elseif ($action == 'settings') {
include 'admin/settings.php';
示例7: t2
function t2($time = NULL)
{
if ($time == NULL) {
global $zeitmessung1;
} else {
$zeitmessung1 = $time;
}
$zeitmessung2 = benchmarktime();
$zeitmessung = $zeitmessung2 - $zeitmessung1;
$zeitmessung = substr($zeitmessung, 0, 7);
return $zeitmessung;
}
示例8: preg_quote
$htaccess[] = "RewriteEngine On";
$htaccess[] = "RewriteCond %{HTTP_HOST} ^www\\." . preg_quote($host) . "\$ [NC]";
$htaccess[] = "RewriteRule ^(.*)\$ http://" . $host . "/\$1 [R=301,L]";
$htaccess[] = "";
}
$filesystem->file_put_contents('.htaccess', implode("\r\n", $htaccess));
}
$breadcrumb = new breadcrumb();
$breadcrumb->Add($config['fname'], 'index.php');
$phpdoc = new OutputDoc($config['gzip']);
$phpdoc->Start($config['gzcompression']);
define('PAGE_IS_GZIPPED', $config['gzip'] == 1 && $phpdoc->Encoding());
($code = $plugins->load('frontend_init')) ? eval($code) : null;
// Global and important functions (not for cron and external)
if (defined('TEMPNOFUNCINIT') == false || $config['foffline'] && defined('TEMPSHOWLOG') == false) {
define('SCRIPT_START_TIME', benchmarktime());
$slog = new slog();
$my = $slog->logged();
$lang->init($my->language);
$tpl = new tpl();
$slog->checkBan();
}
if ($config['foffline'] && defined('TEMPSHOWLOG') == false) {
$my->p = $slog->Permissions();
if ($my->p['admin'] != 1) {
$offline = file_get_contents('data/offline.php');
sendStatusCode(503, 3600);
($code = $plugins->load('frontend_init_offline')) ? eval($code) : null;
echo $tpl->parse("offline");
$phpdoc->Out();
$db->close();
示例9: parseSmileys
function parseSmileys($text, $type = 'html')
{
$start = benchmarktime();
if ($type != 'plain') {
$this->cache_smileys();
foreach ($this->smileys as $smiley) {
// Old way to replace smileys - use this when you have problems with smileys
// $text = str_replace(' '.$smiley['search'], ' <img src="'.$smiley['replace'].'" border="0" alt="'.$smiley['desc'].'" />', $text);
if (strpos($text, $smiley['search']) !== false) {
$text = preg_replace('~(\\r|\\n|\\t|\\s|\\>|\\<|^)' . preg_quote($smiley['search'], '~') . '(\\r|\\n|\\t|\\s|\\>|\\<|$)~s', '\\1<img src="' . $smiley['replace'] . '" border="0" alt="' . $smiley['desc'] . '" />\\2', $text);
}
}
}
$this->benchmark['smileys'] += benchmarktime() - $start;
return $text;
}
示例10: foot
function foot($nocopy = false)
{
if ($nocopy == false) {
global $config, $benchmark, $db, $lang;
$benchmark = round(benchmarktime() - $benchmark, 5);
$queries = $db->benchmark('queries');
$lang->assign('queries', $queries);
$lang->assign('benchmark', $benchmark);
?>
<br style="line-height: 8px;" />
<div class="stext center">[<?php
echo $lang->phrase('admin_benchmark_generation_time');
?>
] [<?php
echo $lang->phrase('admin_benchmark_queries');
?>
]</div>
<div id="copyright">
<strong><a href="http://www.viscacha.org" target="_blank">Viscacha <?php
echo $config['version'];
?>
</a></strong><br />
Copyright © 2004-2007, MaMo Net
<?php
echo iif($config['pccron'] == 1, '<img src="cron.php" width="0" height="0" alt="" />');
?>
</div>
<?php
}
?>
</body>
</html>
<?php
}
示例11: job_benchmark_end
function job_benchmark_end($zeitmessung1)
{
$zeitmessung2 = benchmarktime();
$zeitmessung = $zeitmessung2 - $zeitmessung1;
$zeitmessung = substr($zeitmessung, 0, 6);
return $zeitmessung;
}
示例12: benchmark
function benchmark($start = 0)
{
$zeitmessung = benchmarktime();
if ($start == 0) {
if ($this->benchmarktime == 0) {
$this->errormsg = 'Benchmark was not started yet!';
return -1;
}
$time = $zeitmessung - $this->benchmarktime;
return substr($time, 0, 6);
} else {
$this->benchmarktime = $zeitmessung;
}
}
示例13: parseSmileys
function parseSmileys($text, $type = 'html')
{
$thiszm1 = benchmarktime();
if ($type != 'plain') {
foreach ($this->smileys as $smiley) {
$smiley['search'] = htmlentities($smiley['search'], ENT_QUOTES);
$smiley['desc'] = str_replace('"', '"', $smiley['desc']);
$smiley['replace'] = str_replace('{folder}', $this->profile['SmileyUrl'], $smiley['replace']);
$text = str_replace(' ' . $smiley['search'], ' <img src="' . $smiley['replace'] . '" border="0" alt="' . $smiley['desc'] . '" />', $text);
}
}
$thiszm2 = benchmarktime();
$this->benchmark['smileys'] += $thiszm2 - $thiszm1;
return $text;
}