Created
June 21, 2018 09:31
-
-
Save VitaliiTsilnyk/706fd5e35ccc190dfebd47c1a4e19bf7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 memdiff($id = null) { | |
static $int = null; | |
$current = memory_get_usage(); | |
if ($int === null) { | |
$int = $current; | |
} else { | |
printf("MEM (%s) %d (%+d)\n", $id, $current, $current - $int); | |
$int = $current; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment