PHP code example of asika / simple-benchmark

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

    

asika / simple-benchmark example snippets




/** @var \SimpleBenchmark\Benchmark $benchmark */




/** @var \SimpleBenchmark\Benchmark $benchmark */
$benchmark->addTask('task1-md5', function() {
    md5(uniqid());
});

$benchmark->addTask('task2-sha1', function() {
    sha1(uniqid());
});
 bash
sb run TaskName.php
 bash
php benchmark run TaskName.php 15000