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


PHP benchmarktime函数代码示例

本文整理汇总了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;
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:30,代码来源:class.template.php

示例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 &copy; 2004-2006, MaMo Net
        <?php 
    echo iif($config['pccron'] == 1, '<img src="cron.php" width="0" height="0" alt="" />');
    ?>
    </div>
    </body>
    </html>
	<?php 
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:27,代码来源:function.viscacha_backend.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;
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:13,代码来源:class.bbcode.php

示例4: job_benchmark_end

function job_benchmark_end($start)
{
    $duration = benchmarktime() - $start;
    $duration = round($duration, 5);
    return $duration;
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:6,代码来源:function.cron.php

示例5: t2

function t2($start = null)
{
    if ($start === null) {
        $start = SCRIPT_START_TIME;
    }
    $duration = benchmarktime() - $start;
    $duration = round($duration, 5);
    return $duration;
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:9,代码来源:function.viscacha_frontend.php

示例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';
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:admin.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;
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:12,代码来源:function.viscacha_frontend.php

示例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();
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:31,代码来源:function.frontend_init.php

示例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;
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:16,代码来源:class.bbcode.php

示例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 &copy; 2004-2007, MaMo Net
	        <?php 
        echo iif($config['pccron'] == 1, '<img src="cron.php" width="0" height="0" alt="" />');
        ?>
	    </div>
	<?php 
    }
    ?>
    </body>
    </html>
	<?php 
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:34,代码来源:function.viscacha_backend.php

示例11: job_benchmark_end

function job_benchmark_end($zeitmessung1)
{
    $zeitmessung2 = benchmarktime();
    $zeitmessung = $zeitmessung2 - $zeitmessung1;
    $zeitmessung = substr($zeitmessung, 0, 6);
    return $zeitmessung;
}
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:7,代码来源:function.cron.php

示例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;
     }
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:14,代码来源:php.class.php

示例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('"', '&quot;', $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;
 }
开发者ID:BackupTheBerlios,项目名称:viscacha-svn,代码行数:15,代码来源:class.bbcode.php


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