Created
March 1, 2021 12:36
-
-
Save arodu/15d51cee013b09cb23c82e89256f7362 to your computer and use it in GitHub Desktop.
check execution time in PHP
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 | |
function getTimeStart() { | |
return microtime(true); | |
} | |
function getExecutionTime($start = ''){ | |
if (!empty($start)) { | |
$end = microtime(true); | |
return 'Execution: ' . number_format($end - $start,3) . ' milliseconds'; | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment