<?php require_once __DIR__ . '/../vendor/autoload.php'; $benchmarker = new \Moznion\BenchMarker(); // run 100 times $bench = $benchmarker->timeThis(100, function () { // do something }, 'awesome title'); // run at least for 1 seconds $bench = $benchmarker->timeThis(-1, function () { // do something }, 'awesome title');
<?php require_once __DIR__ . '/../vendor/autoload.php'; $benchmarker = new \Moznion\BenchMarker(); $bench = $benchmarker->countIt(0.1, function () { // do something }); var_dump($bench);
<?php require_once __DIR__ . '/../vendor/autoload.php'; $benchmarker = new \Moznion\BenchMarker(); $bench = $benchmarker->cmpThese(100, ["code A" => function () { // do something }, "code B" => function () { // do something }]);
<?php require_once __DIR__ . '/../vendor/autoload.php'; $benchmarker = new \Moznion\BenchMarker(); $bench = $benchmarker->timeIt(100, function () { // do something }); var_dump($bench);