PHPackages                             hhpack/performance - 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. hhpack/performance

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

hhpack/performance
==================

Performance utility library for Hack

1.3.0(7y ago)24MITHack

Since Nov 1Pushed 7y agoCompare

[ Source](https://github.com/hhpack/performance)[ Packagist](https://packagist.org/packages/hhpack/performance)[ RSS](/packages/hhpack-performance/feed)WikiDiscussions master Synced today

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

performance
===========

[](#performance)

[![Latest Stable Version](https://camo.githubusercontent.com/508bde1bb479c0d90e153cdcf7341bb7751a04143ca7eabfd20c11f4ad7dc637/68747470733a2f2f706f7365722e707567782e6f72672f68687061636b2f706572666f726d616e63652f762f737461626c65)](https://packagist.org/packages/hhpack/performance)[![Build Status](https://camo.githubusercontent.com/ed82e3640bcc69d43103f88ce2fab816e09e6fe2a36419a4717ac3bf51e500c3/68747470733a2f2f7472617669732d63692e6f72672f68687061636b2f706572666f726d616e63652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/hhpack/performance)[![Dependency Status](https://camo.githubusercontent.com/477578dbdc500eaa839eabea404623300f127436359936b8c0c13c42535b903c/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3536396234613066656430383631303034303030303034332f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/569b4a0fed08610040000043)[![License](https://camo.githubusercontent.com/fd672cd8095fa5d1f345a49f7dc2bdc041ad30cdb7548bc6e2f9a0d88766770f/68747470733a2f2f706f7365722e707567782e6f72672f68687061636b2f706572666f726d616e63652f6c6963656e7365)](https://packagist.org/packages/hhpack/performance)

[![Screen Shot](https://raw.githubusercontent.com/hhpack/performance/master/screen-shot.png)](https://raw.githubusercontent.com/hhpack/performance/master/screen-shot.png)

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

[](#basic-usage)

You can measure the time of easy processing.

```
use HHPack\Performance\PerformanceWatcher;
use HHPack\Performance\TimeWatcher;
use HHPack\Performance\MemoryWatcher;
use HHPack\Performance\Result\WatchedResult;

$watcher = PerformanceWatcher::fromItems([
    Pair { 'time', new TimeWatcher() },
    Pair { 'memory', new MemoryWatcher() }
]);

$watcher->start();
$watcher->stop();

$texts = $watcher->result()->mapWithKey(($key, $result) ==> {
    return sprintf("%s: %s", $key, (string) $result->value());
})->values();

foreach ($texts as $text) {
    echo $text, PHP_EOL;
}
```

Benchmark
---------

[](#benchmark)

```
use HHPack\Performance as bench;

function sync_benchmarker() : void
{
    bench\sync()->times(10)->run(() ==> {
        usleep(2000);
    });
}
sync_benchmarker();
```

or

```
use HHPack\Performance as bench;

async function async_benchmarker_main() : Awaitable
{
    await bench\async()->times(10)->run(async () ==> {
        await \HH\Asio\usleep(2000);
    });
}

\HH\Asio\join(async_benchmarker_main());
```

Run the test
------------

[](#run-the-test)

You can run the test with the following command.

```
composer install
composer test

```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity72

Established project with proven stability

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

Recently: every ~93 days

Total

19

Last Release

2817d ago

Major Versions

0.6.1 → 1.0.02017-02-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/70c299d6d6015ee714954aa05e4d0e9c7b1d31318a5d7db5e9bb4e1f70f78afc?d=identicon)[holyshared](/maintainers/holyshared)

---

Top Contributors

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

---

Tags

benchmarkhacklanghhvmperformancememorytimetimerhack

### Embed Badge

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

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

###  Alternatives

[bvanhoekelen/performance

PHP performance tool analyser your script on time, memory usage and db query. Support Laravel and Composer for web, web console and command line interfaces.

520824.8k5](/packages/bvanhoekelen-performance)[ayesh/php-timer

High-resolution and monotonic stop-watch for all your needs. Supports timer start, pause, resume, stop, read, and minimal conversion.

22232.8k12](/packages/ayesh-php-timer)[icecave/chrono

A date &amp; time library that is decoupled from the system clock.

54193.6k7](/packages/icecave-chrono)[dragon-code/benchmark

Simple comparison of code execution speed between different options

12036.2k6](/packages/dragon-code-benchmark)

PHPackages © 2026

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