Created
April 3, 2012 23:55
-
-
Save scodx/2296457 to your computer and use it in GitHub Desktop.
memoria usada en un request de 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 _mem($val = null) | |
{ | |
$val = ($val) ? $val : memory_get_peak_usage(true) | |
$unit=array('B','KB','MB','GB','TB','PB'); | |
return @round($val/pow(1024,($i=floor(log($val,1024)))),2).' '.$unit[$i]; | |
} | |
echo _mem(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment