1. Go to this page and download the library: Download windwalker/profiler 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/ */
windwalker / profiler example snippets
php
use Windwalker\Profiler\Profiler;
$profiler = new Profiler;
$profiler->mark('StartRender');
// Execute some code...
$profiler->mark('AfterRender');
// Execute some code...
$profiler->mark('End');
php
use Windwalker\Profiler\Banchmark;
$benchmark = new Benchmark;
$benchmark->addTask('task1', function()
{
md5(uniqid());
})
->addTask('task2', function()
{
sha1(uniqid());
});
$benchmark->execute(10000);
echo $benchmark->render();
php
$benchmark->setTimeFormat(Benchmark::MILLI_SECOND)->execute(10000);
echo $benchmark->render();
/* Result
task1 => 187.489986 ms
task2 => 207.049847 ms
*/