PHPackages                             wizzaro/execution-code-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. wizzaro/execution-code-timer

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

wizzaro/execution-code-timer
============================

The library provides an easy way to measure the execution time of the code

1.0.0(7y ago)099MITPHPPHP ^5.6 || ^7.0

Since Jan 16Pushed 7y agoCompare

[ Source](https://github.com/Wizzaro/execution-code-timer)[ Packagist](https://packagist.org/packages/wizzaro/execution-code-timer)[ Docs](https://github.com/Wizzaro/execution-code-timer.git)[ RSS](/packages/wizzaro-execution-code-timer/feed)WikiDiscussions master Synced 3d ago

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

Wizzaro Execution Code Timer
============================

[](#wizzaro-execution-code-timer)

The library provides an easy way to measure the execution time of the code

Sample Usage
------------

[](#sample-usage)

```
$timer = new Wizzaro\ExecutionCodeTimer\Timer(true);
sleep(2);
echo $timer->getExecutionInfo();

```

Api
---

[](#api)

### Constructor

[](#constructor)

```
public Timer::__construct(bool $startMeasurement = false)

```

#### Parameters:

[](#parameters)

- startMeasurement - start measurement while creating the object

### startMeasurement

[](#startmeasurement)

Start measurement

```
public function startMeasurement(): void

```

#### Exceptions:

[](#exceptions)

- Throws `Exception` if try started measurement again

### hasMeasurementWasStarted

[](#hasmeasurementwasstarted)

Check is measurement has already started

```
public function hasMeasurementWasStarted(): bool

```

### getExecutionInfo

[](#getexecutioninfo)

```
public function getExecutionInfo(string $format = ''): string

```

Parameters:

- format - (OPTIONAL) - execution information format - more information about format structure find on:

#### Return:

[](#return)

- Return information about the execution time of the code based on format

### setExecutionInfoFormat

[](#setexecutioninfoformat)

Set default format for information about the execution time of the code

```
public function setExecutionInfoFormat(string $format): void

```

#### Parameters:

[](#parameters-1)

- format - execution information format - more information about format structure find on:

### getExecutionInfoFormat

[](#getexecutioninfoformat)

```
public function getExecutionInfoFormat(): string

```

#### Return:

[](#return-1)

- Return default format for information about the execution time of the code

### getExecutionTime

[](#getexecutiontime)

```
public function getExecutionTime(): DateInterval

```

#### Return:

[](#return-2)

- Return interval between start measurement time and current time

### getStartTime

[](#getstarttime)

```
public function getStartTime(): DateTimeInterface

```

#### Return:

[](#return-3)

- Return start measurement time

#### Exceptions:

[](#exceptions-1)

- Throws `Exception` if measurement has not started

### getCurrentTime

[](#getcurrenttime)

```
public function getCurrentTime(): DateTimeInterface

```

#### Return:

[](#return-4)

- Return current time bassed on microtime

Runing Tests
------------

[](#runing-tests)

To run tests:

1. Clone the repository:

```
$ git clone https://github.com/Wizzaro/execution-code-timer.git
$ cd execution-code-timer

```

2. Install dependencies via composer:

```
$ composer install

```

If you don't have composer installed, please download it from

3. Run the tests using the "test" command shipped in the composer.json:

```
$ composer test

```

You can turn on conditional tests with the phpunit.xml file. To do so:

Copy `phpunit.xml.dist` file to `phpunit.xml`Edit `phpunit.xml` to enable any specific functionality you want to test, as well as to provide test values to utilize.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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

2676d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/72a35b881e601ae99d6ea23036eb2a7ebc3954c821abb7c37c17b1032d1915d5?d=identicon)[przemyslawdziadek](/maintainers/przemyslawdziadek)

---

Top Contributors

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

---

Tags

timerexecutionwizzaro

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wizzaro-execution-code-timer/health.svg)

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

###  Alternatives

[icecave/chrono

A date &amp; time library that is decoupled from the system clock.

54188.9k7](/packages/icecave-chrono)[dragon-code/benchmark

Simple comparison of code execution speed between different options

11934.7k5](/packages/dragon-code-benchmark)[ayesh/php-timer

High-resolution and monotonic stop-watch for all your needs. Supports timer start, pause, resume, stop, read, and minimal conversion.

22226.4k11](/packages/ayesh-php-timer)

PHPackages © 2026

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