calgamo/bench

This package is abandoned and no longer maintained. The author suggests using the stk2k/bench package instead.

Benchmark library for Calgamo Framework.

0.7.0 2019-10-23 21:48 UTC

This package is auto-updated.

Last update: 2019-11-19 04:02:52 UTC


README

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.