Skip to content

Instantly share code, notes, and snippets.

@VitaliiTsilnyk
Created June 21, 2018 09:31
Show Gist options
  • Save VitaliiTsilnyk/706fd5e35ccc190dfebd47c1a4e19bf7 to your computer and use it in GitHub Desktop.
Save VitaliiTsilnyk/706fd5e35ccc190dfebd47c1a4e19bf7 to your computer and use it in GitHub Desktop.
<?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