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

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

jakovic/timer
=============

A simple PHP package for measuring execution time

02.3k—10%PHP

Since Mar 18Pushed 1y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Jakovic Timer
=============

[](#jakovic-timer)

A simple PHP package for measuring execution time in your applications.

🚀 Installation
--------------

[](#-installation)

You can install the package via Composer:

```
composer require jakovic/timer
```

🔧 Usage
-------

[](#-usage)

First, import and create an instance of the `Timer` class:

```
use Jakovic\Timer;
```

### ✅ Basic Example

[](#-basic-example)

```
use Jakovic\Timer;

$timer = new Timer();
$timer->start();
sleep(5); // Simulate some process
$timer->end();

echo $timer->getSeconds(); // e.g. 5.0032
echo $timer->getMinutes(); // e.g. 0.0833
echo $timer->getHours();   // e.g. 0.0014
echo $timer->total();      // e.g. 00:00:05
```

### ✅ Multiple Timers Example

[](#-multiple-timers-example)

```
$timer1 = new Timer();
$timer2 = new Timer();

$timer1->start();
sleep(3);
$timer1->end();

$timer2->start();
sleep(5);
$timer2->end();

echo "Timer 1: " . $timer1->total() . "\n"; // 00:00:03
echo "Timer 2: " . $timer2->total() . "\n"; // 00:00:05
```

🛠 Methods
---------

[](#-methods)

- `$timer->start()` - Starts the timer
- `$timer->end()` - Stops the timer
- `$timer->getSeconds()` - Returns elapsed time in seconds (float), e.g., `5.0032`
- `$timer->getMinutes()` - Returns elapsed time in minutes (float), e.g., `0.0833`
- `$timer->getHours()` - Returns elapsed time in hours (float), e.g., `0.0014`
- `$timer->total()` - Returns elapsed time in `H:i:s` format, e.g., `00:00:05`

📜 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT License](./LICENSE).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/875abe04da697ad90f1d093b399bd424e7e0f688cf06ae684edc30ff4d185e3c?d=identicon)[sjakovic](/maintainers/sjakovic)

### Embed Badge

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

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

###  Alternatives

[enniosousa/server-error-pages

Laravel server-side error pages

175.6k](/packages/enniosousa-server-error-pages)

PHPackages © 2026

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