PHP code example of maddrid / bench

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

    

maddrid / bench example snippets


use Maddrid\Bench as Bench ;

Bench::start('first_point');
  do_some_math
    Bench::start('second_point');
      do_more_math
    Bench::stop('second_point');
    Bench::start('third_point');
      do_more_math
    Bench::stop('third_point');
Bench::stop('first_point');
 

Bench::printTimers(true);

Bench::printTimers();

Bench::getTimers();
Bench::getTimers(null);
Bench::getTimers(true);
Bench::getTimers(null,5);
Bench::getTimers(true,5);

Bench::stop('first_point'); 

Bench::stop('first_point',true);

Bench::stop('first_point',true);