Home >Backend Development >PHP Tutorial >How to get page execution time in PHP
This article mainly introduces the relevant information on the method of PHP to obtain the page execution time (recommended). Friends who need it can refer to
Some loop codes. Sometimes if you want to know the page execution time, you can add The following lines of code go to the head and tail of the page:
Header:
<?php $stime=microtime(true);
Tail:
$etime=microtime(true);//获取程序执行结束的时间 $total=$etime-$stime; //计算差值 ?>
Final output:
echo "
The above is the entire content of this article, I hope it will be helpful to everyone's study.
Related recommendations:
PHP gets the URL of the current page, php gets the current page
PHP gets the URL of the current page, php gets the current page_PHP tutorial
The above is the detailed content of How to get page execution time in PHP. For more information, please follow other related articles on the PHP Chinese website!