PHPackages                             veloper/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. veloper/bench

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

veloper/bench
=============

A light-weight class for quickly benchmarking/timing/profiling PHP code

1316.7k↓50%9[1 issues](https://github.com/veloper/Bench/issues)PHP

Since Jun 4Pushed 8y ago2 watchersCompare

[ Source](https://github.com/veloper/Bench)[ Packagist](https://packagist.org/packages/veloper/bench)[ RSS](/packages/veloper-bench/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Bench
=====

[](#bench)

Purpose
-------

[](#purpose)

A light-weight class for quickly benchmarking/timing/profiling PHP code.

Basic Usage
-----------

[](#basic-usage)

```
/**
 * Start & Stop
 */
 include 'class.Bench.php';
 Bench::start();
 // [Some Code To Test]
 echo Bench::stop() . ' Seconds'; -> 2.13274598122

/**
 * Marks
 */
 include 'class.Bench.php';
 Bench::start();
 // [Application Bootstrap]
 Bench::mark('bootstrap');
 // [Database Connection Opened]
 Bench::mark('database');
 // [Data Processing + Manipulation]
 Bench::mark('processing');
 // [HTML Creation]
 Bench::mark('html');
 // [MISC]
 Bench::stop();

 // Get data on specific mark.
 print_r(Bench::getMarkById('database')); // ->
    Array (
         // The mark id.
         [id] => database
         // The microtime(true) of when this mark occurred.
         [microtime] => 1287969552.88
         // The time (in seconds) since start() was called.
         [since_start] => 1.10582304001
         // The time since the last mark [or] since start(), if first call to mark().
         [since_last_mark] => 0.171210050583
     )

 // Get statistics
 print_r(Bench::getStats()); // ->
     Array (
         // The average time between marks (in seconds)
         [mark_average] => 0.346896330516
         // The longest mark
         [mark_longest] => Array
             (
                 [id] => database
                 [microtime] => 1288045989.62
                 [since_start] => 1.02174592018
                 [since_last_mark] => 0.831446886063
             )
         // The shortest mark
         [mark_shortest] => Array
             (
                 [id] => processing
                 [microtime] => 1288045989.64
                 [since_start] => 1.04068899155
                 [since_last_mark] => 0.0189430713654
             )
         // Start microtime
         [start] => 1288060408.82
         // Stop microtime (if called)
         [stop] => 1288060409.95
         // Time elapsed (in seconds)
         [elapsed] => 1.0407409668
     )

```

More examples available at

Website
-------

[](#website)

License
-------

[](#license)

Bench is released under the New BSD license.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/340358?v=4)[Daniel Doezema](/maintainers/veloper)[@veloper](https://github.com/veloper)

---

Top Contributors

[![veloper](https://avatars.githubusercontent.com/u/340358?v=4)](https://github.com/veloper "veloper (5 commits)")[![szepeviktor](https://avatars.githubusercontent.com/u/952007?v=4)](https://github.com/szepeviktor "szepeviktor (1 commits)")

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/veloper-bench/health.svg)](https://phpackages.com/packages/veloper-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)[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)[beyondcode/helo-laravel

HELO Laravel debug helper

90360.1k](/packages/beyondcode-helo-laravel)

PHPackages © 2026

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