Skip to content

Instantly share code, notes, and snippets.

@koriym
Last active Aug 29, 2015
Embed
What would you like to do?
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