Download the PHP package moznion/benchmarker without Composer

On this page you can find all versions of the php package moznion/benchmarker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package benchmarker

BenchMarker Build Status

Benchmark running times of PHP code (inspired by Benchmark.pm)

Synopsis

Description

Library for benchmarking the running times of PHP code.

This library is inspired by Benchmark of Perl

Methods

new($style_name=null, $format=null, $enable_cache=null)

Creates the instance of BenchMarker.

Specify the name of style. Default value is auto.

Please see also Style.

Specify the format to format the values of benchmark's result. It supports the format which is compatible with sprintf()'s one.

Default value is '5.2f'.

Specify cache the elapsed time of nop function (elapsed time of nop is used internal for accuracy). If you enable caching, processing time of benchmark will be faster.

Default value is 'false'.

timeIt($count, $code)

Run a chunk of code and see how long it goes.

This method returns instance of result-time.

$count is the number of times to run the loop. This argument must be positive integer.

$code is the code to run. This argument must be callable variable.

countIt($time, $code)

See how many times a chunk of code runs in a given time.

This method returns instance of result-time.

$time is the minimum length of time to run the loop.

$code is the code to run. This argument must be callable variable.

timeThis($count, $code, $title=null)

Run a chunk of code several times and print result of benchmark.

This method returns instance of result-time.

$count is the number of times to run the loop. This argument must be positive integer.

This argument can be zero or negative. This means the minimum number of CPU seconds to run. A zero signifies the default of 3 seconds.

$code is the code to run. This argument must be callable variable.

Title of result. $title defaults to "timethis $count".

timeThese($count, $codes)

Run several chunks of code several times and print result of benchmark.

This method returns instance of result-time of array for each codes.

$count is the number of times to run the loop. This argument must be positive integer.

This argument can be zero or negative. This means the minimum number of CPU seconds to run. A zero signifies the default of 3 seconds.

$codes is the array of codes to run.

cmpThese($count, $codes)

Print results of timeThese as a comparison chart.

$count is the number of times to run the loop. This argument must be positive integer.

This argument can be zero or negative. This means the minimum number of CPU seconds to run. A zero signifies the default of 3 seconds.

$codes is the array of codes to run.

timeStr($time_result, $count=null)

Print formatted time.

instance of result-time.

Number of loops. If this argument is not null then this method appends the rate.

timeDiff($new_time, $old_time)

Calculates difference between $new_time and $old_time.

Arguments must be instance of result-time.

clearCache($count)

Clear the caching of nop function which is related $count.

clearAllCache()

Clear all of the caching of nop function.

disableCache()

Disable to cache the caching of nop function.

enableCache()

Enable to cache the caching of nop function.

Result Time

Time class has 6 public members.

Real duration.

Duration of system time.

Duration of user time.

Duration of system time of child processes.

Duration of user time of child processes.

Times of loop to run.

Style

This library supports 5 styles.

Output all of the result of benchmarking.

Output the result of benchmarking without child processes result.

Output the result of benchmarking without parent processes result.

Output nothing.

If child processes CPU time is bigger than 0 then this style is the same as "all". Elsewise, this style is the same as "noc".

Requires

PHP (version 5.4 or later)

See Also

Notes

This library doesn't work on Microsoft Windows.

License

MIT


All versions of benchmarker with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package moznion/benchmarker contains the following files

Loading the files please wait ....