<?php
// You can optionally profile CPU time and/or memory usage:
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
(PECL xhprof >= 0.9.0)
xhprof_enable — 启动 xhprof 性能分析器
null
版本 | 说明 |
---|---|
PECL xhprof 0.9.2 |
添加可选的 options 参数。
|
示例 #1 xhprof_enable() 示例
<?php
// 1. elapsed time + memory + CPU profiling; and ignore built-in (internal) functions
xhprof_enable(XHPROF_FLAGS_NO_BUILTINS | XHPROF_FLAGS_CPU | XHPROF_FLAGS_MEMORY);
// 2. elapsed time profiling; ignore call_user_func* during profiling
xhprof_enable(
0,
array('ignored_functions' => array('call_user_func',
'call_user_func_array')));
// 3. elapsed time + memory profiling; ignore call_user_func* during profiling
xhprof_enable(
XHPROF_FLAGS_MEMORY,
array('ignored_functions' => array('call_user_func',
'call_user_func_array')));
?>
<?php
// You can optionally profile CPU time and/or memory usage:
xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);