PHPackages                             kevinlebrun/benchmark - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. kevinlebrun/benchmark

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

kevinlebrun/benchmark
=====================

My little benchmark library

1.0(9y ago)219MITPHPPHP &gt;=5.6.0

Since Mar 10Pushed 9y ago1 watchersCompare

[ Source](https://github.com/kevinlebrun/benchmark)[ Packagist](https://packagist.org/packages/kevinlebrun/benchmark)[ Docs](https://github.com/kevinlebrun/benchmark)[ RSS](/packages/kevinlebrun-benchmark/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (2)Versions (2)Used By (0)

Benchmark
=========

[](#benchmark)

[![Build Status](https://camo.githubusercontent.com/0588fdd949f5240016e23ed18714ec96c534a5b781e5f60ce064a311b35c1e55/68747470733a2f2f7365637572652e7472617669732d63692e6f72672f6b6576696e6c656272756e2f62656e63686d61726b2e706e67)](http://travis-ci.org/kevinlebrun/benchmark?branch=master)

My little simple benchmark library for PHP.

Usage
-----

[](#usage)

Look at the `example.php` file.

```
$echo = Benchmark::run(function ($b) {
    for ($i = 0; $i < $b->getN(); $i++) {
        echo "Something";
    }
}, 'echo');
$present($echo);

$sleep = Benchmark::run(function ($b) {
    sleep(2);

    // You can reset the timer in case of heavy bootstraping code
    $b->reset();
    for ($i = 0; $i < $b->getN(); $i++) {
        echo "Something";
    }
}, 'echo with bootstraping code');
$present($sleep);
```

Install
-------

[](#install)

Installation via composer is highly recommended.

```
{
    "require": {
        "kevinlebrun/benchmark": "1.*"
    }
}
```

```
$ php composer.phar install

```

Contributing
------------

[](#contributing)

Install development dependencies:

```
$ php composer.phar install --dev

```

All tests must pass:

```
$ vendor/bin/phpunit -c phpunit.xml

```

Code style conventions must be followed:

```
$ vendor/bin/phpcs --standard=phpcs.xml -p .

```

License
-------

[](#license)

(The MIT License)

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3399d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9d0eea8b2174323ff97ee190aa71696639965c2bfd2c47c9e94b3c71a632ee10?d=identicon)[kevinlebrun](/maintainers/kevinlebrun)

---

Top Contributors

[![kevinlebrun](https://avatars.githubusercontent.com/u/798082?v=4)](https://github.com/kevinlebrun "kevinlebrun (3 commits)")

---

Tags

benchmarklibrarymeasureperformancephpperformancetimebenchmarkbenchmeasuretiming

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/kevinlebrun-benchmark/health.svg)

```
[![Health](https://phpackages.com/badges/kevinlebrun-benchmark/health.svg)](https://phpackages.com/packages/kevinlebrun-benchmark)
```

###  Alternatives

[symfony/clock

Decouples applications from the system clock

434192.7M340](/packages/symfony-clock)[devster/ubench

Micro PHP library for benchmarking

5641.0M34](/packages/devster-ubench)[ayesh/php-timer

High-resolution and monotonic stop-watch for all your needs. Supports timer start, pause, resume, stop, read, and minimal conversion.

22232.8k12](/packages/ayesh-php-timer)[dragon-code/benchmark

Simple comparison of code execution speed between different options

12036.2k6](/packages/dragon-code-benchmark)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
