How to get page execution time in PHP

墨辰丷
Release: 2023-03-28 11:26:01
Original
2257 people have browsed it

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);
Copy after login


Tail:


$etime=microtime(true);//获取程序执行结束的时间
$total=$etime-$stime;  //计算差值
?>
Copy after login


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!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!