<?php
function bytesConvert($bytes) {
$ext = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
$unitCount = 0;
for(; $bytes > 1024; $unitCount++) $bytes /= 1024;
return round($bytes, 2) ." ". $ext[$unitCount];
}
echo "Memory used: ". bytesConvert(memory_get_usage());
// do yourFunction here
echo "\n";
echo "Memory used: ". bytesConvert(memory_get_usage());
?>
Title:
Check used memory for PHP script running
Description:
<?php function bytesConvert($bytes) { $ext = array('B', 'kB', 'MB', 'GB', 'TB', '...
...
Rating:
4