PHP code example of darraghb / bottler

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

    

darraghb / bottler example snippets

 php

$bottler->staticPerformance('methodName', 'arg1', 'arg2');

 php
e Darraghb\Bottler\Bottler;

#Initialize bottler and specify the unit of measurement (seconds|nanoseconds)

$bottler = new Bottler(
	['unit' => 'seconds', 
	'fileName' => __FILE__]);

 php
$bottler->staticPerformance('mySlowTest', 20, 5000);

function mySlowTest($start= false, $loop = false)
{
	$ans = '';
	for ($i=0; $i < $loop; $i++) { 
		$ans = $i;
	}
}
 php
$bottler = new Bottler(
	['unit' => 'seconds', 
	'fileName' => __FILE__,
	'this' => $this]);

$bottler->performance('methodName', 20, 5000);