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

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

gabrielef/timer
===============

Tiny PHP timer utility to measure time

0.0.2(4y ago)05MITPHP

Since Jul 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/gabrielef/timer)[ Packagist](https://packagist.org/packages/gabrielef/timer)[ Docs](https://github.com/gabrielef/timer)[ RSS](/packages/gabrielef-timer/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

Timer
=====

[](#timer)

Tiny PHP timer utility to measure time

Install
-------

[](#install)

```
$ composer require gabrielef/timer
```

Usage
-----

[](#usage)

Start a new timer with name and precision:

```
use gabrielef\Timer;

$t = new Timer();
$t->start('firstTimer', 3);
```

Retrieve the amount of time passed of a specific timer:

```
use gabrielef\Timer;

$t = new Timer();
$t->start('firstTimer', 3);

//...
//after 1s

echo $t->look('firstTimer'); //ex. 1.234
```

Stop the timer (this will also delete the timer):

```
use gabrielef\Timer;
$t = new Timer();
$t->start('firstTimer');

//...
//after 3s

echo $t->end('firstTimer'); //ex. 3
```

List all the available timer key:

```
use gabrielef\Timer;

$t = new Timer();
$t->start('firstTimer');
$t->start('secondTimer');
$t->start('thirdTimer');

$list = $t->list(); // ['firstTimer', 'secondTimer', 'thirdTimer]
```

Test
----

[](#test)

Currently using PHPUnit with the following command:

```
$ docker run --rm -v $(pwd):/app -w /app php:7.3-cli ./vendor/bin/phpunit --debug
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

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

Every ~0 days

Total

2

Last Release

1805d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6473ab0ad8789b1aa3eb4fc1f23b3559176746828efcceee9dca440bcb744947?d=identicon)[gabrielef](/maintainers/gabrielef)

---

Top Contributors

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

---

Tags

timetimer

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/clock

Decouples applications from the system clock

436205.7M391](/packages/symfony-clock)[knplabs/knp-time-bundle

Making your dates and durations look sensible and descriptive

6339.5M56](/packages/knplabs-knp-time-bundle)[league/period

Time range API for PHP

7335.8M24](/packages/league-period)[brick/date-time

Date and time library

3663.8M108](/packages/brick-date-time)[aeon-php/calendar

PHP type safe, immutable calendar library

20810.4M16](/packages/aeon-php-calendar)[kartik-v/yii2-date-range

An advanced Yii 2 date range picker input for based on bootstrap-daterangepicker plugin.

924.6M42](/packages/kartik-v-yii2-date-range)

PHPackages © 2026

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