Skip to content

Instantly share code, notes, and snippets.

@sbisbee
Created November 22, 2010 15:19
Show Gist options
  • Save sbisbee/710102 to your computer and use it in GitHub Desktop.
Save sbisbee/710102 to your computer and use it in GitHub Desktop.
A useful function to show progressive memory diffs when benchmarking.
function memory_show_usage()
{
$base = null;
if(is_null($base))
{
$base = 1;
$base = memory_get_usage;
}
echo (memory_get_usage() - $base)." bytes\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment