提示信息

PHP获取页面执行时间的方法

日光倾城 已关注

头部:

  1. $stime = microtime(true);

尾部:

  1. $etime = microtime(true);//获取程序执行结束的时间
  2. $total = $etime - $stime; //计算差值

最后输出:

  1. echo "<br />当前页面执行时间为:{$total} 秒";
日光倾城 关注 已关注

最近一次登录:2020-04-01 20:45:19   

暂时还没有签名,请关注我或评论我的文章
×
分享到朋友圈