PHPackages                             dominicwatts/stopwatch - 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. [CLI &amp; Console](/categories/cli)
4. /
5. dominicwatts/stopwatch

ActiveMagento2-module[CLI &amp; Console](/categories/cli)

dominicwatts/stopwatch
======================

Magneto 2 console commands with symfony stopwatch

1.0.0(5y ago)00proprietaryPHPPHP ~5.6.0||~7.0.0||~7.1.0||~7.2.0||~7.3.0

Since Jun 2Pushed 5y ago1 watchersCompare

[ Source](https://github.com/DominicWatts/Stopwatch)[ Packagist](https://packagist.org/packages/dominicwatts/stopwatch)[ RSS](/packages/dominicwatts-stopwatch/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Magneto 2 Stopwatch
===================

[](#magneto-2-stopwatch)

Experiment using Symfony timer component and magento console command. For monitoring performance of console commands.

Install
-------

[](#install)

```
composer require symfony/stopwatch

```

Usage
-----

[](#usage)

```
[...]
use Symfony\Component\Stopwatch\Stopwatch;
[...]
```

```
$stopwatch = new Stopwatch();
// starts event named 'eventName'
$stopwatch->start('eventName');
// ... run your code here
$event = $stopwatch->stop('eventName');
// you can convert $event into a string for a quick summary
// e.g. (string) $event = '4.50 MiB - 26 ms'
$event->getCategory();   // returns the category the event was started in
$event->getOrigin();     // returns the event start time in milliseconds
$event->ensureStopped(); // stops all periods not already stopped
$event->getStartTime();  // returns the start time of the very first period
$event->getEndTime();    // returns the end time of the very last period
$event->getDuration();   // returns the event duration, including all periods
$event->getMemory();     // returns the max memory usage of all periods
```

### Sample Console script

[](#sample-console-script)

```
/**
 * {@inheritdoc}
 */
protected function execute(
    InputInterface $input,
    OutputInterface $output
) {
    $this->state->setAreaCode(Area::AREA_GLOBAL);
    $output->writeln('Start');

    $stopwatch = new Stopwatch();
    $stopwatch->start('stopwatch');

    // lengthy process

    $event = $stopwatch->stop('stopwatch');
    $output->writeln((string) $event);
    $output->writeln((string) __("Start : %1", date("d-m-Y H:i:s", (int) ($event->getOrigin() / 1000))));
    $output->writeln((string) __("End : %1", date("d-m-Y H:i:s", (int) (($event->getOrigin() + $event->getEndTime()) / 1000))));
    $output->writeln((string) __("Memory : %1 MiB", $event->getMemory() / 1024 / 1024));
    $output->writeln('Finish');
}
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Unknown

Total

1

Last Release

2169d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44d79495721d844614b7004c5811ff2ab7cf15c9be3544000f7ee89f3e187de3?d=identicon)[DominicPixie](/maintainers/DominicPixie)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/dominicwatts-stopwatch/health.svg)

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

###  Alternatives

[yireo/magento2-theme-commands

CLI commands to manipulate themes

1334.2k1](/packages/yireo-magento2-theme-commands)

PHPackages © 2026

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