2017 © Pedro Peláez
 

library benchy

simple Benchmark tool

image

ackintosh/benchy

simple Benchmark tool

  • Sunday, June 9, 2013
  • by ackintosh
  • Repository
  • 1 Watchers
  • 0 Stars
  • 5 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Benchy

Benchy is simple and pluggable benchmark tool., (*1)

The build status of the current master branch is tracked by Travis CI: Build Status, (*2)

Installation

composer.json, (*3)

{
    "require": {
        "ackintosh/benchy": "dev-master"
    }
}
$ php composer.phar install

Usage

<?php
require_once 'vendor/autoload.php';

$reporter = Ackintosh\Benchy::run(function ($reporter) {

    // do something

    echo $reporter->time->elapsed() . PHP_EOL;

    // do something

    echo $reporter->time->elapsed() . PHP_EOL;

}, 1000); // runs 1,000 times.(default : 1 )

echo 'total : ' . $reporter->time->total() . PHP_EOL;
echo 'average : ' . $reporter->time->average() . PHP_EOL;

Extending Benchy

Create your sexy code in Ackintosh/Bechy/Marker directory., (*4)

Ackintosh/Benchy/Marker/Example.php, (*5)

<?php
class Example extends AbstractMarker{
    public function hoge() {}
}
<?php
$reporter->example->hoge();

Hook points

  • before
  • after
  • before_per_laps
  • after_per_laps
<?php
class Example extends AbstractMarker{
    // override
    public function before()
    {
        // runs before benchmarking
    }
}

The Versions

09/06 2013

dev-master

9999999-dev

simple Benchmark tool

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

benchmark