PHPackages                             coff/ticker - 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. coff/ticker

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

coff/ticker
===========

Clock based event dispatcher

v3.0.0(3y ago)0341MITPHPPHP &gt;=8.1

Since Mar 18Pushed 3y ago1 watchersCompare

[ Source](https://github.com/coff/ticker)[ Packagist](https://packagist.org/packages/coff/ticker)[ RSS](/packages/coff-ticker/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

Ticker
======

[](#ticker)

Simple yet powerful time period based event dispatcher.

Features
--------

[](#features)

- lightweight algorithm - see `Ticker::loop()`
- open architecture - see: `TickInterface`, `TickableTrait`
- automatically determined main loop's sleep time (based upon defined Ticks) to save on processor usage - see: `Ticker::updateActiveTicks()`
- threading supported for PHP 7.2+ - see:
- several ways of defining task to be executed:
    - callbacks
    - trait based
    - extending class based
    - through factory (for threading)

Usage examples
--------------

[](#usage-examples)

### Callback based

[](#callback-based)

```
$ticker = new Ticker();

$ticker->addTick(new Tick(Time::SECOND, 1, function () {
    // do it every second
}));

$ticker->addTick(new Tick(Time::SECOND, 5, function () {
    // do it every 5 seconds
}));

$ticker->addTick(new Tick(Time::MINUTE, 1, function() {
    // do it every minute
}));

$ticker->loop();
```

### Extending class based

[](#extending-class-based)

```
$tick = new class extends Tick {

    protected $everyN = 1;
    protected $interval = Time::HOUR;

    public function run()
    {
        // hourly task
    }
}

$ticker = new Ticker();
$ticker->addTick($tick);
$ticker->loop();
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity76

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

Total

5

Last Release

1366d ago

Major Versions

v1.0.0-beta → v2.0.02018-03-22

v2.1.0 → v3.0.0-beta2022-07-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/2b28b2b3ed2956f8e7e09346399a1da038e30d831ca3e5ecd308e888237b6aa9?d=identicon)[coff](/maintainers/coff)

---

Top Contributors

[![coff](https://avatars.githubusercontent.com/u/3470380?v=4)](https://github.com/coff "coff (26 commits)")

---

Tags

event-dispatcherevent-emitterphpphp-librarypthreadsthreadingticker

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/coff-ticker/health.svg)

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

###  Alternatives

[symfony/event-dispatcher-contracts

Generic abstractions related to dispatching event

3.4k756.5M424](/packages/symfony-event-dispatcher-contracts)[symfony/polyfill-php85

Symfony polyfill backporting some PHP 8.5+ features to lower PHP versions

4241.6M86](/packages/symfony-polyfill-php85)

PHPackages © 2026

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