PHP code example of fsth / xhprof

1. Go to this page and download the library: Download fsth/xhprof library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

fsth / xhprof example snippets


    compose install 
    
    $xhprof = new FSth\XHProf\XHProf('test', true);
    $xhprof->setLibPath($libPath)->setUrl($url)->init();
    or
    $xhprof = new FSth\XHProf\XHProf('test', true, array(
        'libPath' => $libPath,
        'url' => $url
    ));
    $xhprof->init();
    
    $xhprof->start();
    $a = [];
    $b = [];
    for ($i = 0; $i < 10000; $i++) {
        $a[] = $i;
        $b[] = $i % 100;
    }
    array_diff($a, $b);
    $xhprof->stop();