Today I’m going to give you a very useful snippet that you can use in your further projects to see the execution time of the script.The principle is pretty simple.You will need to define a variable at the start microtime() and one at the end.After that you will need to subtract the end microtime variable from the start microtime variable and thats it.Also you can set the output value to only show the first 2 decimals.
$start = microtime(true);
//Your Script Content here
$end = microtime(true);
$time = number_format(($end - $start), 2);
echo 'This page loaded in ', $time, ' seconds';