Php/docs/function.xhprof-enable

提供:Dev Guides
< Php
移動先:案内検索

xhprof_enable

(PECL xhprof >= 0.9.0)

xhprof_enablexhprof プロファイラを開始する


説明

xhprof_enable ([ int $flags = 0 [, array $options ]] ) : void

xhprof のプロファイリングを開始します。


パラメータ

flags
オプションのフラグで、プロファイル用の追加情報を指定します。フラグの詳細な情報は XHprof 定数 を参照ください。たとえば XHPROF_FLAGS_MEMORY はメモリのプロファイリングを有効にします。
options
オプション項目の配列。つまり、 'ignored_functions' オプションで関数を渡すと、 その関数のプロファイリングを無視したりできます。


返り値

null


変更履歴

バージョン 説明
PECL xhprof 0.9.2 オプションのパラメータ options が追加されました。


例1 xhprof_enable() の例

<?php// 1. elapsed time + memory + CPU profiling; and ignore built-in (internal) functionsxhprof_enable(XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);// 2. elapsed time profiling; ignore call_user_func* during profilingxhprof_enable(    0,    array('ignored_functions' =>  array('call_user_func',                                        'call_user_func_array')));                                       // 3. elapsed time + memory profiling; ignore call_user_func* during profilingxhprof_enable(    XHPROF_FLAGS_MEMORY,    array('ignored_functions' =>  array('call_user_func',                                        'call_user_func_array')));?>

参考