1. Go to this page and download the library: Download phine/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/ */
phine / bench example snippets
use Phine\Bench\Suite;
use Phine\Bench\Test;
$suite = new Suite();
$suite[] = new Test(
function () {
usleep(500);
}
);
$suite['key'] = new Test(
function () {
sleep(1);
}
);
$suite['setup'] = Test::create(
function ($sleep, $usleep) {
sleep($sleep);
usleep($usleep);
}
)->setSetup(
function () {
return array(
rand(0, 2),
rand(500, 1000)
);
}
);
list($total, $times) = $suite->run();
echo $total, "\n"; // 3.003720998764
echo $times[0], "\n"; // 0.0012569427490234
echo $times['key'], "\n"; // 1.0002269744873
echo $times['setup'], "\n"; // 2.0022370815277
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.