Home >Backend Development >PHP Tutorial >PHP simple method to calculate page loading time, PHP calculation page loading_PHP tutorial
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.