Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stk2k/bench
Simple benchmark classes
https://github.com/stk2k/bench
Last synced: 4 days ago
JSON representation
Simple benchmark classes
- Host: GitHub
- URL: https://github.com/stk2k/bench
- Owner: stk2k
- License: mit
- Created: 2019-11-19T03:53:19.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-05T17:18:35.000Z (over 3 years ago)
- Last Synced: 2024-11-08T20:14:23.067Z (about 2 months ago)
- Language: PHP
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Simple benchmark classes
=======================[![Latest Version on Packagist](https://img.shields.io/packagist/v/stk2k/bench.svg?style=flat-square)](https://packagist.org/packages/stk2k/bench)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://travis-ci.org/stk2k/bench.svg?branch=master)](https://travis-ci.org/stk2k/bench)
[![Coverage Status](https://coveralls.io/repos/github/stk2k/bench/badge.svg?branch=master)](https://coveralls.io/github/stk2k/bench?branch=master)
[![Code Climate](https://codeclimate.com/github/stk2k/bench/badges/gpa.svg)](https://codeclimate.com/github/stk2k/bench)
[![Total Downloads](https://img.shields.io/packagist/dt/stk2k/bench.svg?style=flat-square)](https://packagist.org/packages/stk2k/bench)## Description
Simple benchmark classes
## Feature
## Demo
### Exsample 1: time benchmark shorthand
```php
use Stk2k\Bench\TimeBenchmark;$handle = TimeBenchmark::start();
// benchmark target code here
$score = TimeBenchmark::score($handle);
echo 'score: ' . $score . ' msec';
```### Exsample 2: memory benchmark shorthand
```php
use Stk2k\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.2 or later
## Installing stk2k/bench
The recommended way to install stk2k/bench is through
[Composer](http://getcomposer.org).```bash
composer require stk2k/bench
```After installing, you need to require Composer's autoloader:
```php
require 'vendor/autoload.php';
```## License
[MIT](https://github.com/stk2k/bench/blob/master/LICENSE)## Author
[stk2k](https://github.com/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.