PHP.nl

xhprof_enable

xhprof_enable

Start xhprof profiler

void **xhprof_enable** int $flags array $options

Start xhprof profiling.

flags Optional flags to add additional information to the profiling. See the for further information about these flags, e.g., to enable memory profiling. XHprof constantsXHPROF_FLAGS_MEMORY

options An of optional options, namely, the 'ignored_functions' option to pass in functions to be ignored during profiling. array

null

Voorbeeld: examples

<?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')));
?>

xhprof_disable``xhprof_sample_enable``memory_get_usage``getrusage