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

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

guanhui07/timer
===============

php timer

v1.0.0(3y ago)16MITPHPPHP &gt;=7.4

Since Feb 17Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

timer
=====

[](#timer)

php定时器，参考了workerman源码 实现一个单进程(守护进程)的定时器。

原理
--

[](#原理)

1. 利用pcntl，守护进程化
2. 利用stream\_select的超时机制，来实现sleep，如果有event扩展的话，优先使用event扩展
3. 定时器是时间堆的方式实现，利用php的spl的优先队列

install
-------

[](#install)

```
composer require guanhui07/timer
```

use
---

[](#use)

./test/index.php

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

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

Unknown

Total

1

Last Release

1185d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3abde3fccf025ce86670101d7cfa0641d2415c9daad93e5f0c9573a2b23ddbda?d=identicon)[guanhui07](/maintainers/guanhui07)

---

Top Contributors

[![guanhui07](https://avatars.githubusercontent.com/u/5820457?v=4)](https://github.com/guanhui07 "guanhui07 (1 commits)")

---

Tags

phptimer

### Embed Badge

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

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

PHPackages © 2026

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