Checking loading time more precisely

For checking loading time of my webpage, I made the code below.

<?php $openTime=time(); ?>

My text start
abcdefg hijklmn opqrstu vwxyz
My text end
<?php $closeTime=time();
$loadingTime=$closeTime-$openTime;
echo $loadingTime;
?>

Since the unit of the unix time is second, the loading time is usually “0” second.
I like to check the loading time more precisely.
For example, 1/100 , 1/1000, or 1/10,000 second.instead of a second.

Can I check the loading time more precisely than a second by your help?

.

https://www.php.net/microtime
https://www.php.net/hrtime

Symfony has a Stopwatch component that can simplify things a bit.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.