https://github.com/jacobbednarz/php-bench
Benchmarking PHP, the easy way
https://github.com/jacobbednarz/php-bench
Last synced: about 2 months ago
JSON representation
Benchmarking PHP, the easy way
- Host: GitHub
- URL: https://github.com/jacobbednarz/php-bench
- Owner: jacobbednarz
- Created: 2014-11-17T08:46:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-02T04:04:48.000Z (about 10 years ago)
- Last Synced: 2024-10-10T16:30:57.879Z (7 months ago)
- Language: PHP
- Size: 180 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP Benchmark - The easy way
This is designed to make benchmarking PHP easy.
### Installation
```
git clone [email protected]:jacobbednarz/php-bench.git
```### Usage
To run the benchmark, you need to include the class into a file and instantiate the class.
```php
report('foo', 'my_method');
$b->report('foo2', 'my_method2');
$b->bench();
```Expected output:
```
$ php benchmark.phpIDENTIFIER EXECUTION TIME MEMORY USAGE
foo 0.00003099ms 128b
foo2 0.00000906ms 128b
```### Set the iterations
If you need to perform more iterations than the default (10), you can use `setIterations()` to set the value.
```php
setIterations(1000);
$b->report('foo', 'my_method');
$b->report('foo2', 'my_method2');
$b->bench();
```