PHPackages                             mmdm/sim-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. mmdm/sim-benchmark

ActiveLibrary

mmdm/sim-benchmark
==================

A simple yet nice benchmark for your codes

v1.0.3(5y ago)122MITPHPPHP &gt;=7.2

Since Oct 5Pushed 5y ago1 watchersCompare

[ Source](https://github.com/mmdm95/sim-benchmark)[ Packagist](https://packagist.org/packages/mmdm/sim-benchmark)[ RSS](/packages/mmdm-sim-benchmark/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (4)Used By (0)

Simplicity Benchmark
====================

[](#simplicity-benchmark)

A library to benchmark codes time elapsed and memory usage.

Install
-------

[](#install)

**composer**

```
composer require mmdm/sim-benchmark
```

Or you can simply download zip file from github and extract it, then put file to your project library and use it like other libraries.

Just add line below to autoload files:

```
require_once 'path_to_library/autoloader.php';
```

and you are good to go.

How to use
----------

[](#how-to-use)

```
// to instance a benchamrk object
$benchmark = new Benchmark();
$label = 'a label';

// start benchmark here
$benchmark->start($label);
// here you should write your algorithm
// ...
// now you can stop benchmark
$benchmark->stop($label);

//now you can see result like this
$benchmark->getReport($label);
```

Available functions
-------------------

[](#available-functions)

start($label):

This method starts a benchmark for a specific label.

Note: This method just work one time for a specific label.

```
$benchmark->start($label);
```

pause($label):

This method pause a benchmark for a specific label.

Note: If you use this method multiple times before resume method, first call will apply.

```
$benchmark->pause($label);
```

resume($label):

This method resume a benchmark for a specific label.

Note: If you use this method multiple times before pause method, first call will apply.

```
$benchmark->resume($label);
```

stop($label):

This method stop a benchmark for a specific label.

Note: This method just work one time for a specific label.

```
$benchmark->stop($label);
```

getTime($label):

This method get time for a specific label.

Note: Use this function before start and stop methods, will cause exception.

Note: Returns time as microseconds in float format

```
$time = $benchmark->getTime($label);
```

getMemory($label):

This method get memory for a specific label.

Note: Use this function before start and stop methods, will cause exception.

Note: Returns memory as bytes in int format

```
$memory = $benchmark->getMemory($label);
```

get($label):

This method get time and memory for a specific label.

Note: Use this function before start and stop methods, will cause exception.

Note: Returns an array like below format

```
array [
    'time' => $time, // 2 microsecond(s), etc.
    'memory' => $memory // 10MiB, etc.
]
```

```
$res = $benchmark->get($label);
```

getReport($label):

This method show a report of a specific label.

Note: Use this function before start and stop methods, will cause exception.

Note: This method is **void**

```
$benchmark->getReport($label);
```

License
=======

[](#license)

Under MIT license.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~81 days

Total

3

Last Release

1884d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d955ebaae3fe602e6ad26c16422f6ab25a61a436fd7f08425a5be5c73ef9025c?d=identicon)[mmdm95](/maintainers/mmdm95)

---

Top Contributors

[![mmdm95](https://avatars.githubusercontent.com/u/26489185?v=4)](https://github.com/mmdm95 "mmdm95 (18 commits)")

### Embed Badge

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

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

PHPackages © 2026

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