calgamo / bench
Benchmark library for Calgamo Framework.
Installs: 2 022
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- calgamo/util: ~0.1
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ^6.3.0
README
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
Author
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.