Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vnext-nguyen-quyen/2da0ec8e47aed54c667fe41db5b0811e to your computer and use it in GitHub Desktop.
Save vnext-nguyen-quyen/2da0ec8e47aed54c667fe41db5b0811e to your computer and use it in GitHub Desktop.
PHP get memory and excution usage
# 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