2017 © Pedro Peláez
 

library bench

A PHP library for running timed tests.

image

phine/bench

A PHP library for running timed tests.

  • Thursday, December 12, 2013
  • by kherge
  • Repository
  • 1 Watchers
  • 6 Stars
  • 224 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 8 % Grown

The README.md

Bench

Build Status Coverage Status Latest Stable Version Total Downloads, (*1)

Simplifies the process of creating and running benchmarks. The library self- calibrates so that the framework itself is not counted in the amount of time it takes to complete any of the tests., (*2)

Usage

use Phine\Bench\Suite;
use Phine\Bench\Test;

$suite = new Suite();

$suite[] = new Test(
    function () {
        usleep(500);
    }
);

$suite['key'] = new Test(
    function () {
        sleep(1);
    }
);

$suite['setup'] = Test::create(
    function ($sleep, $usleep) {
        sleep($sleep);
        usleep($usleep);
    }
)->setSetup(
    function () {
        return array(
            rand(0, 2),
            rand(500, 1000)
        );
    }
);

list($total, $times) = $suite->run();

echo $total, "\n";          // 3.003720998764
echo $times[0], "\n";       // 0.0012569427490234
echo $times['key'], "\n";   // 1.0002269744873
echo $times['setup'], "\n"; // 2.0022370815277

Requirement

Installation

Via Composer:, (*3)

$ composer require "phine/bench=~1.0"

Documentation

You can find the documentation in the docs/ directory., (*4)

License

This library is available under the MIT license., (*5)

The Versions

12/12 2013

dev-master

9999999-dev https://github.com/phine/lib-bench

A PHP library for running timed tests.

  Sources   Download

MIT

The Requires

 

The Development Requires

test benchmark

17/09 2013

1.2.0

1.2.0.0 https://github.com/phine/lib-bench

A PHP library for running timed tests.

  Sources   Download

MIT

The Requires

 

The Development Requires

test benchmark

30/08 2013

1.1.0

1.1.0.0 https://github.com/phine/lib-bench

A PHP library for running timed tests.

  Sources   Download

MIT

The Requires

 

The Development Requires

test benchmark

30/08 2013

1.0.0

1.0.0.0 https://github.com/phine/lib-bench

A PHP library for running timed tests.

  Sources   Download

MIT

The Requires

 

The Development Requires

test benchmark