PHPackages                             phauthentic/phpunit-execution-timing-extension - 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. phauthentic/phpunit-execution-timing-extension

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

phauthentic/phpunit-execution-timing-extension
==============================================

PHPUnit extension to track and report test execution times

1.2.0(5mo ago)03.5k↓43.2%1MITPHPPHP ^8.1CI passing

Since Dec 13Pushed 5mo agoCompare

[ Source](https://github.com/Phauthentic/phpunit-execution-timing-extension)[ Packagist](https://packagist.org/packages/phauthentic/phpunit-execution-timing-extension)[ RSS](/packages/phauthentic-phpunit-execution-timing-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

PHPUnit Execution Timing Extension
==================================

[](#phpunit-execution-timing-extension)

A PHPUnit extension that tracks and reports test execution times, helping you identify slow tests in your test suite.

Features
--------

[](#features)

- Tracks execution time for each test
- Displays a summary of the slowest tests after test execution
- Configurable number of slowest tests to display
- Optional per-test timing output
- Color-coded output based on configurable thresholds (yellow for warnings, red for danger)
- Aligned column formatting for easy reading
- Compatible with PHPUnit 10, 11, and 12

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- PHPUnit 10, 11, or 12

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

[](#installation)

Install via Composer:

```
composer require --dev phauthentic/phpunit-execution-timing-extension
```

Configuration
-------------

[](#configuration)

Add the extension to your `phpunit.xml.dist` or `phpunit.xml` file:

```

```

### Configuration Parameters

[](#configuration-parameters)

- **`topN`** (default: `10`): Number of slowest tests to display in the summary report
- **`showIndividualTimings`** (default: `false`): Whether to display timing for each test as it runs
- **`showFQCN`** (default: `true`): Whether to display fully qualified class names (FQCN) or just the class name. When set to `false`, only the class name without namespace will be shown (e.g., `MyTestClass::testMethod` instead of `Phauthentic\PHPUnit\ExecutionTiming\Tests\MyTestClass::testMethod`)
- **`warningThreshold`** (default: `1.0`): Time in seconds at which tests will be colored yellow (warning). Tests with execution time &gt;= this value will be highlighted.
- **`dangerThreshold`** (default: `5.0`): Time in seconds at which tests will be colored red (danger). Tests with execution time &gt;= this value will be highlighted in red. Tests between `warningThreshold` and `dangerThreshold` will be colored yellow.

Usage
-----

[](#usage)

After running your tests, you'll see a summary report at the end showing the slowest tests. Tests are color-coded based on their execution time:

- **Yellow**: Tests that exceed the warning threshold (default: 1 second)
- **Red**: Tests that exceed the danger threshold (default: 5 seconds)
- **Normal**: Tests below the warning threshold

```
Top 10 slowest tests:

  1. ⏱ 1234.56 ms (1.235 s) MyTest::testSlowOperation                    [colored red]
  2. ⏱  987.65 ms (0.988 s) AnotherTest::testComplexCalculation          [colored yellow]
  3. ⏱  654.32 ms (0.654 s) DatabaseTest::testLargeQuery                 [colored yellow]
  ...

```

Note: The actual output will show ANSI color codes when viewed in a terminal that supports colors. The colors help quickly identify tests that may need optimization.

### Example Output

[](#example-output)

With `showIndividualTimings` set to `true`, you'll also see timing for each test as it executes:

```
  ⏱  MyTest::testSomething: 123.45 ms
  ⏱  AnotherTest::testOther: 45.67 ms

```

Example Configuration
---------------------

[](#example-configuration)

### Basic Configuration

[](#basic-configuration)

```

```

### With Individual Timings Enabled

[](#with-individual-timings-enabled)

```

```

### With Custom Thresholds

[](#with-custom-thresholds)

```

```

This configuration will:

- Show yellow for tests taking 0.5 seconds or more
- Show red for tests taking 2.0 seconds or more

### With Short Class Names (showFQCN disabled)

[](#with-short-class-names-showfqcn-disabled)

```

```

This configuration will display only the class name without the full namespace path, making the output more compact:

- `MyTestClass::testMethod` instead of `Phauthentic\PHPUnit\ExecutionTiming\Tests\MyTestClass::testMethod`

How It Works
------------

[](#how-it-works)

The extension subscribes to PHPUnit events:

- **Test Preparation Started**: Records the start time for each test
- **Test Finished**: Calculates duration and optionally displays it
- **Execution Finished**: Generates and displays the summary report

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

[](#contributing)

Contributions are welcome! Please feel free to submit a Pull Request.

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

Copyright
---------

[](#copyright)

Copyright (c) Florian Krämer ()

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance73

Regular maintenance activity

Popularity24

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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

Total

4

Last Release

152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2bef35c03b7865d9cad45c22e54eb6fe8f5fc84a4ff64d47cc0f7a1ef28dbe85?d=identicon)[floriankraemer](/maintainers/floriankraemer)

---

Top Contributors

[![floriankraemer](https://avatars.githubusercontent.com/u/4996022?v=4)](https://github.com/floriankraemer "floriankraemer (6 commits)")

---

Tags

phpunitphpunit-extensiontiming-analysistestingphpunitperformanceextensiontiming

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/phauthentic-phpunit-execution-timing-extension/health.svg)

```
[![Health](https://phpackages.com/badges/phauthentic-phpunit-execution-timing-extension/health.svg)](https://phpackages.com/packages/phauthentic-phpunit-execution-timing-extension)
```

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[spatie/phpunit-snapshot-assertions

Snapshot testing with PHPUnit

69617.9M510](/packages/spatie-phpunit-snapshot-assertions)[ergebnis/phpunit-slow-test-detector

Provides facilities for detecting slow tests in phpunit/phpunit.

1468.1M72](/packages/ergebnis-phpunit-slow-test-detector)[robiningelbrecht/phpunit-pretty-print

Prettify PHPUnit output

76460.0k15](/packages/robiningelbrecht-phpunit-pretty-print)[friendsofcake/fixturize

CakePHP Fixture classes to help increase productivity or performance

24504.7k1](/packages/friendsofcake-fixturize)[juampi92/test-seo

Easy way to test your SEO

26341.0k](/packages/juampi92-test-seo)

PHPackages © 2026

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