
效果演示1

1、在 zibll 主题目录下 themes/zibll/footer.php 文件中的顶部添加下面的代码:
<!---给网站数据库查询&页面加载耗时功能--->
<center>
<p> 本次数据库查询:<?php echo get_num_queries(); ?>次 页面加载耗时<?php timer_stop(3); ?> 秒</p>
</center>
<!---网站数据库查询&页面加载耗时功能狐狸博客 https://huliku.com/--->
演示效果2

在 functions.php 文件中加入以下代码:
/*显示查询次数、查询时间及消耗内存*/
function performance( $visible = true ) {
$stat = sprintf( '%d 次查询 | 用时 %.3f 秒 | 消耗 %.2fMB 内存',
get_num_queries(),
timer_stop( 0, 3 ),
memory_get_peak_usage() / 1024 / 1024
);
echo $visible ? $stat : "<!-- {$stat} -->" ;
}
如果调用的话可以用下面的代码进行(一般放在 footer.php 文件中):
请登录后查看评论内容