PHP code example of chajr / class-benchmark

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

    

chajr / class-benchmark example snippets


\Benchmark\Performance\Timer::start();

sleep 3;

\Benchmark\Performance\Timer::setMarker('sleep');

sleep 5;

\Benchmark\Performance\Timer::setMarker('another sleep');

\Benchmark\Performance\Timer::stop();
var_dump(\Benchmark\Performance\Timer::calculateStats());