Home >Backend Development >PHP Tutorial >PHP simple method to calculate page loading time, PHP calculation page loading_PHP tutorial

PHP simple method to calculate page loading time, PHP calculation page loading_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:49:33888browse

PHP’s simple method of calculating page loading time, php calculating page loading

The example in this article describes the simple method of PHP calculating page loading time. Share it with everyone for your reference. The specific implementation method is as follows:

Simply put the start time at the head of the page and the end time at the end of the page to calculate the page loading time

$start = time();
// put a long operation in here
sleep(2);
$diff = time() - $start;
print "This page needed $diff seconds to load :-)";
// if you want a more exact value, you could use the 
// microtime function

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1019449.htmlTechArticleHow to simply calculate page load time in php, php calculate page load This article describes how to simply calculate page load time in php method. Share it with everyone for your reference. Specific implementation method...
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