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

ActiveLibrary

izabolotnev/php-timer
=====================

Utility class for timing

2.1(10y ago)21.9kBSD-3-ClausePHPPHP &gt;=5.4

Since Sep 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/izabolotnev/php-timer)[ Packagist](https://packagist.org/packages/izabolotnev/php-timer)[ Docs](https://github.com/izabolotnev/php-timer/)[ RSS](/packages/izabolotnev-php-timer/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (1)Versions (8)Used By (0)

[![Build Status](https://camo.githubusercontent.com/8a1607620d82081e9535f51f2a40dd754774a9c7a4b5cfaeba34930590efd554/68747470733a2f2f7472617669732d63692e6f72672f697a61626f6c6f746e65762f7068702d74696d65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/izabolotnev/php-timer)

Timer
=====

[](#timer)

Utility class for timing things

Installation
------------

[](#installation)

To add this package as a local, per-project dependency to your project, simply add a dependency on `izabolotnev/php-timer` to your project's `composer.json` file. Here is a minimal example of a `composer.json` file that just defines a dependency on Timer:

```
{
    "require": {
        "izabolotnev/php-timer": "~2.1"
    }
}

```

Usage
-----

[](#usage)

### Basic Timing

[](#basic-timing)

```
use izabolotnev\Timer;

Timer::start();

// ...

$time = Timer::stop();

print Timer::secondsToTimeString($time);
```

or

```
use izabolotnev\Timer;

Timer::start();

// ...

print Timer::stopAndFormat();
```

The code above yields the output below:

```
0 ms.

```

### Advanced usage

[](#advanced-usage)

```
use izabolotnev\Timer;

Timer::addNewTimer('myTimer');
Timer::start();

sleep(2);

Timer::start('myTimer');
echo 'Default: ', Timer::stopAndFormat(), PHP_EOL;

sleep(3);

echo 'Custom: ', Timer::stopAndFormat('myTimer'), PHP_EOL;
```

The code above yields the output below:

```
Default: 2 s.
Custom: 3 s.

```

###  Health Score

31

—

LowBetter than 71% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 82.8% 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 ~213 days

Recently: every ~241 days

Total

7

Last Release

3650d ago

Major Versions

1.0.7 → 2.12016-03-24

PHP version history (3 changes)1.0.3PHP &gt;=5.2.7

1.0.4PHP &gt;=5.3.3

2PHP &gt;=5.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f1282b778cbd013eac5bac6927030e7df4bc67dc842664897618c48d6b66c9b?d=identicon)[izabolotnev](/maintainers/izabolotnev)

---

Top Contributors

[![sebastianbergmann](https://avatars.githubusercontent.com/u/25218?v=4)](https://github.com/sebastianbergmann "sebastianbergmann (53 commits)")[![whatthejeff](https://avatars.githubusercontent.com/u/306525?v=4)](https://github.com/whatthejeff "whatthejeff (7 commits)")[![sun](https://avatars.githubusercontent.com/u/41992?v=4)](https://github.com/sun "sun (2 commits)")[![henriquemoody](https://avatars.githubusercontent.com/u/154023?v=4)](https://github.com/henriquemoody "henriquemoody (1 commits)")[![mbischof](https://avatars.githubusercontent.com/u/1442526?v=4)](https://github.com/mbischof "mbischof (1 commits)")

---

Tags

timer

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[phpunit/php-timer

Utility class for timing

7.7k863.7M122](/packages/phpunit-php-timer)[hhxsv5/laravel-s

🚀 LaravelS is an out-of-the-box adapter between Laravel/Lumen and Swoole.

3.9k670.9k10](/packages/hhxsv5-laravel-s)[react/promise-timer

A trivial implementation of timeouts for Promises, built on top of ReactPHP.

34040.4M86](/packages/react-promise-timer)[jbzoo/utils

Collection of PHP functions, mini classes and snippets for everyday developer's routine life.

8321.5M34](/packages/jbzoo-utils)[icecave/chrono

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

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

Simple comparison of code execution speed between different options

11933.8k4](/packages/dragon-code-benchmark)

PHPackages © 2026

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