2017 © Pedro Peláez
 

library benchmark

Simple utility to measure your execution time.

image

vesic/benchmark

Simple utility to measure your execution time.

  • Wednesday, May 17, 2017
  • by dusan-vesic-devtech
  • Repository
  • 0 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

benchmark

Benchmark your code, (*1)

Installation

composer require vesic/benchmark

Basic Usage

require __DIR__ . '/vendor/autoload.php';

use Vesic\Benchmark\Benchmark;

$benchmark = new Benchmark;

$bencmark->run(function() {
    for ($i=0; $i<1e6; $i++) { }
});

function yourFunctionToMeasure() {
    // expensive computing
}

$benchmark->run('yourFunctionToMeasure');

function functionWithParams($param) {
    for ($i=0; $i<$param; $i++) { }
}

$benchmark->run('functionWithParams', 1e6);

Output

Your code performance:
Time - 0.017. Memory - 356.75 kb

The Versions

17/05 2017

dev-master

9999999-dev

Simple utility to measure your execution time.

  Sources   Download

MIT

The Requires

 

by vesic

17/05 2017

0.0.1

0.0.1.0

Simple utility to measure your execution time.

  Sources   Download

MIT

The Requires

 

by vesic

17/05 2017

dev-dev

dev-dev

Simple utility to measure your execution time.

  Sources   Download

MIT

The Requires

 

by vesic