PHPackages                             maddrid/bench - 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. [Debugging &amp; Profiling](/categories/debugging)
4. /
5. maddrid/bench

ActiveLibrary[Debugging &amp; Profiling](/categories/debugging)

maddrid/bench
=============

( Benchmarking/Profiling ) utility class to measure the amount of time , memory (server load) that elapses between two or more points.

1.0.0(5y ago)08GPL-3.0-or-laterPHP

Since Aug 21Pushed 5y ago1 watchersCompare

[ Source](https://github.com/maddrid/bench)[ Packagist](https://packagist.org/packages/maddrid/bench)[ RSS](/packages/maddrid-bench/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

Bench
=====

[](#bench)

( Benchmarking / Profiling / Timing ) class to measure the amount of time , memory (server load) that elapses between two (or more) points.

Install
-------

[](#install)

```
"require": {
   "maddrid/bench": "dev-master"
  }

```

Usage
-----

[](#usage)

As Simple as Possible

```
use Maddrid\Bench as Bench ;

Bench::start('first_point');
  do_some_math
    Bench::start('second_point');
      do_more_math
    Bench::stop('second_point');
    Bench::start('third_point');
      do_more_math
    Bench::stop('third_point');
Bench::stop('first_point');
```

Display
-------

[](#display)

//more details

```
Bench::printTimers(true);
```

keep it simple

```
Bench::printTimers();
```

Get timers
----------

[](#get-timers)

```
Bench::getTimers();
Bench::getTimers(null);
Bench::getTimers(true);
Bench::getTimers(null,5);
Bench::getTimers(true,5);
```

Stop the timer
--------------

[](#stop-the-timer)

```
Bench::stop('first_point');
```

// will get server load

```
Bench::stop('first_point',true);
```

Known facts
-----------

[](#known-facts)

When getting server load

```
Bench::stop('first_point',true);
```

Will add aditional seconds on the checkpoint . If checkpoint is nested , "the Parent/s " checkpoints will inherit those seconds .

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

2095d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5124319?v=4)[maddrid](/maintainers/maddrid)[@maddrid](https://github.com/maddrid)

---

Top Contributors

[![maddrid](https://avatars.githubusercontent.com/u/5124319?v=4)](https://github.com/maddrid "maddrid (23 commits)")

### Embed Badge

![Health badge](/badges/maddrid-bench/health.svg)

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

###  Alternatives

[symfony/stopwatch

Provides a way to profile code

2.8k387.2M918](/packages/symfony-stopwatch)[fruitcake/laravel-debugbar

PHP Debugbar integration for Laravel

19.1k662.9k29](/packages/fruitcake-laravel-debugbar)[spatie/ignition

A beautiful error page for PHP applications.

510147.6M69](/packages/spatie-ignition)[jokkedk/webgrind

Webgrind is a Xdebug profiling web frontend in PHP5. It implements a subset of the features of kcachegrind and installs in seconds and works on all platforms. For quick'n'dirty optimizations it does the job.

3.3k193.0k](/packages/jokkedk-webgrind)[koriym/printo

An object graph visualizer.

1421.8M2](/packages/koriym-printo)[soloterm/dumps

A Laravel command to intercept dumps from your Laravel application.

125285.7k3](/packages/soloterm-dumps)

PHPackages © 2026

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