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 2w 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 47% 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

4558d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/34284?v=4)[Ross Masters](/maintainers/rmasters)[@rmasters](https://github.com/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

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M387](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.4k](/packages/symfony-framework-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k185.6M2.3k](/packages/symfony-security-bundle)[symfony/security-http

Symfony Security Component - HTTP Integration

1.7k177.2M375](/packages/symfony-security-http)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M332](/packages/api-platform-core)[symfony/ux-autocomplete

JavaScript Autocomplete functionality for Symfony

645.9M38](/packages/symfony-ux-autocomplete)

PHPackages © 2026

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