PHPackages                             atk14/stop-watch - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. atk14/stop-watch

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

atk14/stop-watch
================

StopWatch is a PHP class for precise time measurement. This package is part of the ATK14 Framework.

v0.1(8y ago)036.4k↑22.2%6MITPHPPHP &gt;=5.3.0

Since Dec 1Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/atk14/StopWatch)[ Packagist](https://packagist.org/packages/atk14/stop-watch)[ Docs](https://github.com/atk14/StopWatch)[ RSS](/packages/atk14-stop-watch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (6)

StopWatch
=========

[](#stopwatch)

A PHP class for precise time measurement.

Basic usage
-----------

[](#basic-usage)

```
$s = new StopWatch();

$s->start();
// do something...
$s->stop();

// printing result
echo $s->getResult(); // (float) 3.6618700027466
// or
echo $s; // to string conversion provides humanized output, e.g. "0:03.662"

```

Usual usage
-----------

[](#usual-usage)

```
$s = new StopWatch();

$s->start("total");

  $s->start("parsing_request");
  // do something
  $s->stop("parsing_request");

  $s->start("preparing_data");
  // do something
  $s->stop("preparing_data");

  $s->start("rendering");

    // do something

    $s->start("rendering_partial_template");
    // do something
    $s->stop("rendering_partial_template");

    $s->start("rendering_partial_template");
    // do something
    $s->stop("rendering_partial_template");

  $s->stop("rendering");

$s->stop("total");

```

Print results

```
echo $s->getResult("total"); // 0.034516096115112
echo $s->getResult("rendering"); // 0.017526865005493

```

For overal report there is a special method

```
echo $s->getPrintableOutput();

```

The output is pretty cool :)

```
                     total:  0.034516
           parsing_request:  0.004428
            preparing_data:  0.003821
                 rendering:  0.017527
rendering_partial_template:  0.003695
rendering_partial_template:  0.003743
          ----------------: total
                     total x 1:    0.0345s
           parsing_request x 1:    0.0044s
            preparing_data x 1:    0.0038s
                 rendering x 1:    0.0175s
rendering_partial_template x 2:    0.0074s

```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance54

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity48

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

3082d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6304dffbd91d7a978f98632b0e4e30d662dcdb691daadb1388a58984e98faf5c?d=identicon)[yarri](/maintainers/yarri)

---

Top Contributors

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

---

Tags

string

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/atk14-stop-watch/health.svg)

```
[![Health](https://phpackages.com/badges/atk14-stop-watch/health.svg)](https://phpackages.com/packages/atk14-stop-watch)
```

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[spatie/string

String handling evolved

5604.6M24](/packages/spatie-string)[coduo/php-to-string

Simple library that converts PHP value into strings

27112.7M10](/packages/coduo-php-to-string)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)

PHPackages © 2026

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