PHPackages                             markuszeller/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. markuszeller/php-timer

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

markuszeller/php-timer
======================

Simple Timer Class

v1.1.1(5y ago)047[4 issues](https://github.com/markuszeller/php-timer/issues)MITPHPPHP &gt;=7.4

Since Apr 15Pushed 5y ago1 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (0)

php-timer
=========

[](#php-timer)

Simple Timer Class

[![PHP from Packagist](https://camo.githubusercontent.com/7a280f0e9790e83e04169ec1ec46385d01a9995d55918e9dfd161c10a70c3d72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d61726b75737a656c6c65722f7068702d74696d65722f76312e312e302e737667)](https://camo.githubusercontent.com/7a280f0e9790e83e04169ec1ec46385d01a9995d55918e9dfd161c10a70c3d72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d61726b75737a656c6c65722f7068702d74696d65722f76312e312e302e737667)[![Install with Composer)](https://camo.githubusercontent.com/9adc0e3c00cddcc19b9a6e28e81967340dd80806992a3f9174e6e99d8ad56255/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d6d61726b75737a656c6c65722532467068702d2d74696d652d626c75652e737667)](https://camo.githubusercontent.com/9adc0e3c00cddcc19b9a6e28e81967340dd80806992a3f9174e6e99d8ad56255/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6d706f7365722d6d61726b75737a656c6c65722532467068702d2d74696d652d626c75652e737667)

Init a timer

```
$timer = new Timer();

```

Do something what takes some time and stop the timer.

```
$timer->stop();

```

Assuming the timer took 66.6 seconds for the do-something operations.

Receive the values in different formats:

- Fractioned with 2 decimals

    ```
    // 66.60
    echo $timer->getSecondsFractioned();

    ```
- Rounded as an integer

    ```
    // 67
    echo $timer->getSecondsRounded();

    ```
- Formatted as time hh:mm:ss

    ```
    // 00:01:06
    echo $timer->getTimeFormatted();

    ```
- Formatted as milliseconds

    ```
    // 5000.1788139343
    sleep(5);
    echo $timer->getMilliseconds();

    ```
- Different outputs

```
$timer->setTotal(100);
$timer->setDone(88);

// █████████████████░░░
// 20 chars are default
echo $timer->getProgressAsciiBar(), PHP_EOL;

//  88.00%
echo $timer->getProgressPercentage(), PHP_EOL;

// 88/100
echo $timer->getProgressDone(), PHP_EOL;

```

- You can also define your own output

    - %b - Progress bar
    - %c - Count
    - %p - Percentage

    `%c %b %p` will print
    `  567/1234 █████████░░░░░░░░░░░  45.95%`

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Total

3

Last Release

2027d ago

PHP version history (2 changes)v1.0.0PHP &gt;=7.1

v1.1.0PHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a10b7f1f02a4c79241e1624d8cb19fcc112471cd561854307bb383dd4651fd4?d=identicon)[markuszeller](/maintainers/markuszeller)

---

Top Contributors

[![markuszeller](https://avatars.githubusercontent.com/u/71471?v=4)](https://github.com/markuszeller "markuszeller (16 commits)")

---

Tags

composerhelperpackagephptimer

### Embed Badge

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

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

###  Alternatives

[stingbo/easyexchange

easy use digital currency exchange sdk

871.3k](/packages/stingbo-easyexchange)

PHPackages © 2026

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