Tracking the script execution time in PHP

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.

Functions

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.

0 0 vote
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
DMCA.com Protection Status
0
Would love your thoughts, please comment.x
()
x