Skip to content

Instantly share code, notes, and snippets.

@koriym
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koriym/8801346 to your computer and use it in GitHub Desktop.
Save koriym/8801346 to your computer and use it in GitHub Desktop.
PHPの簡単ベンチマーク ref: http://qiita.com/koriym/items/0c8987faecc2782f2c8a
$time = microtime(true);
register_shutdown_function(
function() use ($time) {
printf("Memory: %s / %s bytes\nTime: %f ms\nDeclared: %d classes\nIncluded: %d files > include_files.txt\n",
number_format(memory_get_usage()),
number_format(memory_get_peak_usage()),
(microtime(true) - $time) * 1000,
count(get_declared_classes()),
count(get_included_files())
);
file_put_contents(__DIR__ . '/include_files.txt', print_r(get_included_files(), true));
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment