PHPackages                             rmasters/stack-timer - 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. rmasters/stack-timer

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

rmasters/stack-timer
====================

Simple StackPHP middleware for timing

v1.0.0(12y ago)115MITPHP

Since Jan 7Pushed 12y ago1 watchersCompare

[ Source](https://github.com/rmasters/stack-timer)[ Packagist](https://packagist.org/packages/rmasters/stack-timer)[ RSS](/packages/rmasters-stack-timer/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

StackTimer [![Build Status](https://camo.githubusercontent.com/916ef82e4a611f6f2f07e8b44ec2bc6b70c8b9bafc9f74d48d2c6795555f349b/68747470733a2f2f7472617669732d63692e6f72672f726d6173746572732f737461636b2d74696d65722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/rmasters/stack-timer) [![Coverage Status](https://camo.githubusercontent.com/d64555f1a5a3c063b90cf334b7df77e934e85ef356261cf7f08a555e74169ebe/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f726d6173746572732f737461636b2d74696d65722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/rmasters/stack-timer?branch=master) [![Latest Stable Version](https://camo.githubusercontent.com/cf74bb620542f3eda296dbf7a1c639a6256ea070eb1afaf270f92e54870fc48d/68747470733a2f2f706f7365722e707567782e6f72672f726d6173746572732f737461636b2d74696d65722f762f737461626c652e706e67)](https://packagist.org/packages/rmasters/stack-timer)
================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#stacktimer---)

A simple [StackPHP](http://stackphp.org/) middleware that reports on the time it takes the inner middlewares/app to run. Written to figure out what Stack can do 😃

Usage
-----

[](#usage)

Simply wrap your application in the timer middleware and the load time will be injected into the response body.

```
$app = new App(); // implements HttpKernelInterface
$timer = new StackTimer($app);

$request = Request::createFromGlobals();
$timer->handle($request)->send();

```

Options
-------

[](#options)

Pass an array with any of the following keys to `StackTimer::__construct(HttpKernelInterface, array)`:

- **inject** (boolean, default: false) - whether to inject into the response body,
- **callbacks** (callable|callable\[\]) - an array of closures/callables that are passed the following arguments: `function(HttpFoundation\Request $request, float $microseconds)`.
- **format** (string, default: `{ms}ms`) - the text to be injected, see list of replaced strings below.
- **wrapper** (string, default: `%s`) - HTML the text is contained in, must contain a single `%s` where the text will be added.
- **injection** (string, default: ``) - where to inject the snippet, this is passed through `preg_quote` and cannot contain regular expressions.
- **inject\_before** (boolean, default: true) - whether to inject the snippet before the injection point (i.e. before ``).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

4513d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/32d44b8b36e16d8e06b489556da46a1e839726b0d6003fcd2642a3c94c8069f7?d=identicon)[rmasters](/maintainers/rmasters)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rmasters-stack-timer/health.svg)

```
[![Health](https://phpackages.com/badges/rmasters-stack-timer/health.svg)](https://phpackages.com/packages/rmasters-stack-timer)
```

###  Alternatives

[illuminate/cookie

The Illuminate Cookie package.

224.3M122](/packages/illuminate-cookie)[codefog/contao-haste

haste extension for Contao Open Source CMS

42650.8k139](/packages/codefog-contao-haste)[netgen/content-browser

Netgen Content Browser is a Symfony bundle that provides an interface which selects items from any kind of backend and returns the IDs of selected items back to the calling code.

14112.1k8](/packages/netgen-content-browser)[leapt/core-bundle

Symfony LeaptCoreBundle

2529.1k4](/packages/leapt-core-bundle)[numero2/contao-storelocator

Contao Plugin for managing stores (or in common address data) and providing a frontend-search based on geo data

121.5k](/packages/numero2-contao-storelocator)

PHPackages © 2026

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