2017 © Pedro Peláez
 

library bench

image

camspiers/bench

  • Saturday, February 22, 2014
  • by camspiers
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Bench

Basic benchmarking, (*1)

Usage

Using bench\mark

bench\mark('somekey');
$result = calculateSomething();
echo bench\format(bench\collector()), PHP_EOL;

Using bench\invoke

$result = bench\invoke('calculateSomething');
echo bench\format(bench\collector()), PHP_EOL;

Using bench\wrap

$fn = bench\wrap('calculateSomething');
$result = $fn();
echo bench\format(bench\collector()), PHP_EOL;

Using bench\collector

bench\collector will collect up results of bench\invoke and bench\wrap., (*2)

When bench\collector is invoked without arguments it will return all results collected., (*3)

When there is only one result it will return that else it will return an array., (*4)

bench\invoke('calculateSomething');
bench\invoke('calculateSomething');
foreach (bench\formatTimes(bench\collector()) as $time) {
    echo $time, PHP_EOL;
}

The Versions

22/02 2014

dev-php-5.6

dev-php-5.6

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

22/02 2014

dev-master

9999999-dev

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

22/02 2014

0.1.0

0.1.0.0

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires