Categories
PHP

Page execution time PHP

Last day we show how to count your Sql queries on PHP. Today we do 1 step more in your app to know how long does it takes to be executed in the server (just to return the html to the browser).

This is kind of important, at least to me to see that everything is going as expected.

I will show you one way of doing this, really easy!

On the start of your code paste this:

$start_time=microtime(true);

Then all your code, html php etc…

In the footer of your html you can display it like this:

echo "Total exectution time:".round((microtime(true)-$start_time),3);

I mean this is really simple….but useful, or not? 😉