PHP code example of best-served-cold / benchmark

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

    

best-served-cold / benchmark example snippets


use BestServedCold\Benchmark\Benchmark;
use BestServedCold\Benchmark\Output;

Benchmark::start();
for ($i = 0; $i <= 100; $i++ ) {
    mt_rand(1, 1000);
}
Benchmark::stop();
Output::output(Benchmark::get())->render();

Benchmark::reset(); // Clear existing benchmarks
Benchmark::start('bob');
$a = str_repeat('Hello', 24000);
define('FOO', 'bar');
Benchmark::stop('bob');
Benchmark::start('mary');
 
Benchmark::reset();
Benchmark::start('susan');
ark::get(), 'apache')->render();