Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
42
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@koriym

PHPの簡単ベンチマーク

使用メモリや実行時間、読み込みファイル等の情報をスクリプト終了時に表示します。

$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));

    }
);
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
42
Help us understand the problem. What are the problem?