calgamo/bench

Benchmark library for Calgamo Framework.


Keywords
php, benchmark
License
MIT

Documentation

Calgamo/Bench, Benchmark library for Calgamo Framework.

Latest Version on Packagist Software License Build Status Coverage Status Code Climate Total Downloads

Description

Calgamo/Bench is a library of benchmark for calgamo framework.

Feature

Demo

Exsample 1: time benchmark shorthand

use Calgamo\Bench\TimeBenchmark;

$handle = TimeBenchmark::start();

// benchmark target code here

$score = TimeBenchmark::score($handle);
echo 'score: ' . $score . ' msec';

Exsample 2: memory benchmark shorthand

use Calgamo\Bench\MemoryBenchmark;

$handle = MemoryBenchmark::start();

// benchmark target code here

$score = MemoryBenchmark::score($handle);
$score = array_map(function($v){ return $v . 'MB'; }, $score);
echo 'score: ' . print_r($score, true);

Usage

Requirement

PHP 7.1 or later

Installing calgamo/bench

The recommended way to install calgamo/bench is through Composer.

composer require calgamo/bench

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

License

MIT

Author

stk2k

Disclaimer

This software is no warranty.

We are not responsible for any results caused by the use of this software.

Please use the responsibility of the your self.