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

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

shiishiji/timer
===============

hrtime wrapper

v1.0.0(2y ago)112MITPHPPHP &gt;=8

Since Nov 4Pushed 2y ago1 watchersCompare

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

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

Timer
=====

[](#timer)

Timer is a PHP library for dealing with precise time measurements.

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

[](#installation)

Use the package manager [composer](https://getcomposer.org) to install Timer.

```
composer require shiishiji/timer
```

Usage
-----

[](#usage)

The usage is really straight forward. Firstly, create an instance of StopWatch class.

```
$timer = new StopWatch();
```

Secondly, use `start()` method to begin measurement. Use `stop()` to end measurement. Lastly `getDuration()` returns string representing measured time in nanoseconds.

```
$timer->start();
sleep(1); // perform action to be measured
$timer->stop();

$result = $timer->getDuration();
var_dump($result); // prints something like -> string(10) "1000273951"
```

Development
-----------

[](#development)

First, build image

```
docker build -t php_timer .
```

To run tests use docker

```
docker run --rm -it php_timer vendor/bin/phpunit tests
```

License
-------

[](#license)

[MIT](https://choosealicense.com/licenses/mit/)

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

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

924d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/192b8afcf69aedd10f6ca1c6f60ace25f41130d7e6a7928b577fd57653bb5196?d=identicon)[Shiishiji](/maintainers/Shiishiji)

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[symfony/deprecation-contracts

A generic function and convention to trigger deprecation notices

2.1k825.6M447](/packages/symfony-deprecation-contracts)[brussens/yii2-maintenance-mode

Maintenance mode component for Yii framework 2.x.x version.

78256.3k5](/packages/brussens-yii2-maintenance-mode)[selvinortiz/flux

Fluent regular expressions in PHP.

3372.0k1](/packages/selvinortiz-flux)[poppy/faker

Poppy Faker is a PHP library that generates fake data for zh user.

309.3k1](/packages/poppy-faker)

PHPackages © 2026

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