版权属于:
婉然│音离
作品采用:
《
署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)
》许可协议授权
{mtitle}记Joe更新频繁导致的代码丢失{/mtitle}
<?php
function timer_start() {
global $timestart;
$mtime = explode( ' ', microtime() );
$timestart = $mtime[1] + $mtime[0];
return true;
}
timer_start();
function timer_stop( $display = 0, $precision = 3 ) {
global $timestart, $timeend;
$mtime = explode( ' ', microtime() );
$timeend = $mtime[1] + $mtime[0];
$timetotal = $timeend - $timestart;
$r = number_format( $timetotal, $precision );
if ( $display )
echo $r;
return $r;
}
?>
适当位置加入即可
<?php echo 'PHP加载: ',timer_stop(), ' s.';?> <!-- 调用Functions.php中的加载时间代码 -->
评论 (0)