PHP code example of ko / php-benchmark

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

    

ko / php-benchmark example snippets


composer 

  $mark = new \KO\Benchmark\Benchmark();

  sleep(3); // Some task that takes time to run
  
  echo $mark->calc();

  $mark = new \KO\Benchmark\Benchmark();

  sleep(3); // Some task that takes time to run

  echo $mark->calc()->toString();

  $mark = new \KO\Benchmark\Benchmark();

  sleep(3); // Some task that takes time to run

  var_dump( $mark->calc()->toArray() );