Hi there guys! Today I am going to share a very useful snippet that you can use to see the execution time of your script while debugging your script.
Tracking the script execution time in PHP is very easy with below simple steps:
First you have to define variables at the start and at the ends and call the
microtime() function at start and end and store the time in those variables.
After that you will need to subtract the end variable from the start variable (micro time) and that’s it. Below is the simple example.
mixed microtime ([ bool $get_as_float = false ] ) — Return current Unix timestamp with microseconds
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.
I am Arjun from Hyderabad (India). I have been working as a software engineer from the last 7+ years, and it is my passion to learn new things and implement them as a practice. Aside from work, I like gardening and spending time with pets.