PHP code example of tomzx / profiler

1. Go to this page and download the library: Download tomzx/profiler 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/ */

    

tomzx / profiler example snippets


$profiler = new \tomzx\Profiler\StackBasedProfiler();
$profiler->start();

// In your code
$profiler->push('My identifier');
///...
$profiler->pop();

$profile = $profiler->stop();
file_put_contents('test.cpuprofile', json_encode($profile));