PHPackages                             miladhspr/performance-analyzer - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. miladhspr/performance-analyzer

ActiveLibrary[Testing &amp; Quality](/categories/testing)

miladhspr/performance-analyzer
==============================

A Test PHP class to measure the execution time of code segments.

v0.0.2(2y ago)04MITPHPPHP ^8.0

Since Mar 8Pushed 2y ago1 watchersCompare

[ Source](https://github.com/miladhspr/performance-analyzer)[ Packagist](https://packagist.org/packages/miladhspr/performance-analyzer)[ RSS](/packages/miladhspr-performance-analyzer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

PerformanceAnalyzer
===================

[](#performanceanalyzer)

PerformanceAnalyzer is a PHP class that helps you measure the execution time of code segments or operations in your PHP applications. It provides methods for starting and stopping a timer, measuring the execution time of a callback function, and displaying the execution time in a human-readable format.

Installation
------------

[](#installation)

You can install PerformanceAnalyzer via Composer:

```
composer require miladhspr/performance-analyzer
```

Usage
-----

[](#usage)

### Starting and Ending Timer

[](#starting-and-ending-timer)

To measure the execution time of a code segment, you can start the timer before the code segment and end it afterward:

```
use MiladHspr\PerformanceAnalyzer;

PerformanceAnalyzer::startTimer();

// Your code segment or operation goes here

PerformanceAnalyzer::endTimer();
```

### Measuring Execution Time of a Callback Function

[](#measuring-execution-time-of-a-callback-function)

You can also measure the execution time of a callback function using the `measureExecutionTime` method:

```
use MiladHspr\PerformanceAnalyzer;

PerformanceAnalyzer::measureExecutionTime(function () {
    // Your callback function or code segment goes here
});
```

### Example

[](#example)

Here's a simple example demonstrating the usage of PerformanceAnalyzer:

```
use MiladHspr\PerformanceAnalyzer;

PerformanceAnalyzer::startTimer();

// Code segment or operation to measure goes here

PerformanceAnalyzer::endTimer();
```

Output
------

[](#output)

PerformanceAnalyzer displays the execution time in a human-readable format, including milliseconds, microseconds, or nanoseconds, depending on the duration of the operation.

License
-------

[](#license)

PerformanceAnalyzer is open-source software licensed under the [MIT license](LICENSE.md).

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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 ~0 days

Total

2

Last Release

800d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/252abfe2680ff07ec6e567de9c62288f57a05b7f42bc3d123c2114dd74b14ba3?d=identicon)[miladhspr](/maintainers/miladhspr)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/miladhspr-performance-analyzer/health.svg)

```
[![Health](https://phpackages.com/badges/miladhspr-performance-analyzer/health.svg)](https://phpackages.com/packages/miladhspr-performance-analyzer)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[beberlei/assert

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)

PHPackages © 2026

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