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

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

alorel/alo-timer
================

A simple countdown class when you need accuracy

1.1(10y ago)32151GPL-3.0+CSS

Since Jul 12Pushed 8y ago1 watchersCompare

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

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

For most things a simple `setTimeout()` or `setInterval()` is enough - but Javascript timers get throttled when the page is minimised/tabbed out of and you will end up with imprecise timings in the long run. This is where AloTimer comes in - you set a timer and poll it with as much precision as you need - while individual polling calls might get throttled, the end result will always be accurate.

[![Coverage Status](https://camo.githubusercontent.com/a63c155ae78e72eb06cc3df3cee467b915b7870d86dbb0cb5b605a543893fe5a/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f416c6f72656c2f616c6f2d74696d65722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/Alorel/alo-timer?branch=master)[![Build Status](https://camo.githubusercontent.com/d78bfe358a18b284266f448e194903190fc882801ef237dc2a20689bb4b76793/68747470733a2f2f7472617669732d63692e6f72672f416c6f72656c2f616c6f2d74696d65722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Alorel/alo-timer)[![Deps](https://camo.githubusercontent.com/7728682cd53fd8e5dc88517d1551a1024c75108ad14fada88df531c21d306f81/68747470733a2f2f64617669642d646d2e6f72672f616c6f72656c2f616c6f2d74696d65722e737667)](https://david-dm.org/alorel/alo-timer#info=dependencies&view=list)[![Deps](https://camo.githubusercontent.com/376058b31f992180ffeb6c9a1bac7d3cca20bfca7586c518558630479e0ff86e/68747470733a2f2f64617669642d646d2e6f72672f616c6f72656c2f616c6f2d74696d65722f6465762d7374617475732e737667)](https://david-dm.org/alorel/alo-timer#info=devDependencies&view=list)

[![NPM](https://camo.githubusercontent.com/c79d67c1d5eaddd4df1d3a0194526b3667db776bed5562d2732bbe4b1bc97a57/68747470733a2f2f6e6f6465692e636f2f6e706d2f616c6f2d74696d65722e706e673f646f776e6c6f6164733d7472756526646f776e6c6f616452616e6b3d747275652673746172733d74727565)](https://www.npmjs.com/package/alo-timer)

Functionality
=============

[](#functionality)

[![Greenkeeper badge](https://camo.githubusercontent.com/529c5c6aff024e938b786a10d393592648d793c6d3111b9df5ee70cd501a9445/68747470733a2f2f6261646765732e677265656e6b65657065722e696f2f416c6f72656c2f616c6f2d74696d65722e737667)](https://greenkeeper.io/)

- Add or subtract any amount of miliseconds/seconds/minutes/hours/days
- Get the amount of any of the above left individually
- Output time left as a DD:HH:mm:ss string (customisable)
- A simple check whether the timeout has finished
- Pause and unpause the timer

Installation
============

[](#installation)

```

```

Or, if you prefer Node,

```
npm install alo-timer --save

```

Usage example
=============

[](#usage-example)

```
var span       = document.getElementById("my-countdown"),
    timer      = new AloTimer(3600000, ["hours", "minutes", "seconds"]), // 1 hr
    intervalCb = function () {
       if (!timer.hasFinished) {
           span.innerText = timer.toString();
       } else {
           span.innerText = "YOUR SCHNITZEL IS DONE!";
           clearInterval(interval);
       }
   },
   interval   = setInterval(intervalCb, 1000);
```

---

More information:

- [Demo](https://alorel.github.io/alo-timer)
- [API documentation](https://alorel.github.io/alo-timer/jsdoc)
- [Test coverage](https://coveralls.io/github/Alorel/alo-timer?branch=master)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~16 days

Total

3

Last Release

3930d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cca267ade0c44a740c602ca62e377789418696ad942cbd1e3d59100b9928f1a2?d=identicon)[Alorel](/maintainers/Alorel)

---

Top Contributors

[![Alorel](https://avatars.githubusercontent.com/u/4998038?v=4)](https://github.com/Alorel "Alorel (32 commits)")[![greenkeeper[bot]](https://avatars.githubusercontent.com/in/505?v=4)](https://github.com/greenkeeper[bot] "greenkeeper[bot] (4 commits)")

---

Tags

javascripttimerstandalonecountdownaccurateaccuracy

### Embed Badge

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

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

###  Alternatives

[tightenco/ziggy

Use your Laravel named routes in JavaScript.

4.3k41.6M267](/packages/tightenco-ziggy)[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)[tedivm/jshrink

Javascript Minifier built in PHP

76037.7M139](/packages/tedivm-jshrink)[dkcwd/dkcwd-zf2-munee

Zend Framework 2 module leveraging 'munee' an asset optimisation library developed by Cody Lundquist. You can find munee at http://github.com/meenie/munee

102.1k](/packages/dkcwd-dkcwd-zf2-munee)

PHPackages © 2026

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