PHPackages                             usernam3/phpunit\_stopwatch\_annotations - 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. usernam3/phpunit\_stopwatch\_annotations

ActiveLibrary

usernam3/phpunit\_stopwatch\_annotations
========================================

phpunit test case with support for execution time and memory usage assertion in annotations

15431PHP

Since Aug 2Pushed 10y ago1 watchersCompare

[ Source](https://github.com/usernam3/phpunit_stopwatch_annotations)[ Packagist](https://packagist.org/packages/usernam3/phpunit_stopwatch_annotations)[ RSS](/packages/usernam3-phpunit-stopwatch-annotations/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PHPUnit stopwatch annotations
-----------------------------

[](#phpunit-stopwatch-annotations)

**PHPUnit stopwatch annotations** is a PHPUnit test case with support for execution time and memory usage assertion in annotations. It uses [symfony/Stopwatch](https://github.com/symfony/Stopwatch) component for tracking time and memory usage of tests.

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

[](#installation)

Via [Composer](https://getcomposer.org/)

```
	composer require --dev "usernam3/phpunit_stopwatch_annotations:dev-master"
```

Usage
-----

[](#usage)

To add support of `@executionTime` and `@memoryUsage` annotations you need to extend your test case class from `\StopwatchAnnotations\TestCase`.

`@executionTime` value is measured in milliseconds `@memoryUsage` in bytes.

Example of test case:

```
class ExampleTest extends \StopwatchAnnotations\TestCase {
    /**
     * @test
     * @executionTime 1999
     */
    public function executionTimeFailed()
    {
        sleep(2);
    }

    /**
    * @test
    * @memoryUsage 2000000
    */
    public function memoryUsageFailed()
    {

    }
}
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/usernam3-phpunit-stopwatch-annotations/health.svg)

```
[![Health](https://phpackages.com/badges/usernam3-phpunit-stopwatch-annotations/health.svg)](https://phpackages.com/packages/usernam3-phpunit-stopwatch-annotations)
```

PHPackages © 2026

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