Last active
October 21, 2016 14:28
-
-
Save napolux/90a619763c61767234b88060b7f878a5 to your computer and use it in GitHub Desktop.
Measure execution time of PHP code
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 | |
$start = microtime(true); | |
// Your code starts here | |
$i = 0; | |
while($i < 5000000) { | |
$i++; | |
} | |
// Your cord ends here | |
$end = microtime(true); | |
echo "Execution time: " . number_format($end - $start,5,',','.') . " seconds"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment