How to measure PHP page load time


Website’s loading speed is an important factor in the success of a website. It is also considered in the search engine ranking by Google. It is not good to have a website which¬†loads slow and takes server resources. So It is a good idea to measure the speed of your PHP code to check which part is taking time.
You can do this with the help of microtime() php function which will help you to measure which part of the PHP code is takaing time.

Put this part of the code at the start of a webpage

and this part of the code at the end of the webpage.

This code will tell you the time taken by the web page in loading.

When some one will access your webpage he will know the exact time taken by the webpage in loading.

You can use this to know the amount of time taken by a piece of code to know which script is taking time. This can help in improving the speed of the website by imrpoving the speed of that code.