Created
July 13, 2023 05:01
-
-
Save vnext-nguyen-quyen/2da0ec8e47aed54c667fe41db5b0811e to your computer and use it in GitHub Desktop.
PHP get memory and excution usage
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
# Check excution time in seconds | |
$start = microtime(true); | |
// Excute PHP scripts | |
echo "Total execution time in seconds: " . (microtime(true) - $start); | |
# Check memory usage in MiB | |
"Real RAM: ".(memory_get_peak_usage(true)/1024/1024)." MiB\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment