Last active
October 6, 2021 13:20
-
-
Save yussan/7b7ded7e3c12bb82d44fbd2f54ad9e39 to your computer and use it in GitHub Desktop.
Generate Total Execution Time on PHP in miliseconds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//place this before any script you want to calculate time | |
$time_start = microtime(true); | |
// your script code goes here | |
// do something | |
Put this at the end of your php file: | |
// Display Script End time | |
$time_end = microtime(true); | |
//total execution time in miliseconds | |
$execution_time = $time_end - $time_start; | |
//execution time of the script | |
echo '<b>Total Execution Time:</b> '.$execution_time.' Miliseconds'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment