Home >Backend Development >PHP Tutorial >How to get page execution time in PHP

How to get page execution time in PHP

墨辰丷
墨辰丷Original
2018-05-29 16:00:282298browse

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 page content

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn