PHPackages                             josantonius/loadtime - 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. josantonius/loadtime

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

josantonius/loadtime
====================

Calculate load time of pages or scripts.

1.1.8(3y ago)54872MITPHPPHP ^5.6 || ^7.0

Since Jan 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/josantonius/php-load-time)[ Packagist](https://packagist.org/packages/josantonius/loadtime)[ GitHub Sponsors](https://github.com/Josantonius)[ RSS](/packages/josantonius-loadtime/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (11)Used By (0)

PHP LoadTime library
====================

[](#php-loadtime-library)

[![Latest Stable Version](https://camo.githubusercontent.com/b1dbaa078f86bba2650e8b02e7e221f2f134667c2125014778b6125c41b30f9f/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73616e746f6e6975732f4c6f616454696d652f762f737461626c65)](https://packagist.org/packages/josantonius/LoadTime)[![License](https://camo.githubusercontent.com/c16a0660ff57079dcba18bf48717e19b9d154fe17818eca65df8347403fa7cde/68747470733a2f2f706f7365722e707567782e6f72672f6a6f73616e746f6e6975732f4c6f616454696d652f6c6963656e7365)](LICENSE)

Calculate load time of pages or scripts.

---

- [Requirements](#requirements)
- [Installation](#installation)
- [Available Methods](#available-methods)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Tests](#tests)
- [Sponsor](#Sponsor)
- [License](#license)

---

Requirements
------------

[](#requirements)

This library is supported by **PHP versions 5.6** or higher and is compatible with **HHVM versions 3.0** or higher.

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

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/download/).

To install **PHP LoadTime library**, simply:

```
composer require Josantonius/LoadTime

```

The previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:

```
composer require Josantonius/LoadTime --prefer-source

```

You can also **clone the complete repository** with Git:

$ git clone

Or **install it manually**:

[Download LoadTime.php](https://raw.githubusercontent.com/Josantonius/php-Load-time/master/src/LoadTime.php):

```
wget https://raw.githubusercontent.com/Josantonius/php-Load-time/master/src/LoadTime.php

```

Available Methods
-----------------

[](#available-methods)

Available methods in this library:

### - Set initial time

[](#--set-initial-time)

```
LoadTime::start();
```

**\# Return** (float) → microtime

### - Set end time

[](#--set-end-time)

```
LoadTime::end();
```

**\# Return** (float) → seconds

### - Check if the timer has been started

[](#--check-if-the-timer-has-been-started)

```
LoadTime::isActive();
```

**\# Return** (boolean)

Quick Start
-----------

[](#quick-start)

To use this library with **Composer**:

```
require __DIR__ . '/vendor/autoload.php';

use Josantonius\LoadTime\LoadTime;
```

Or If you installed it **manually**, use it:

```
require_once __DIR__ . '/LoadTime.php';

use Josantonius\LoadTime\LoadTime;
```

Usage
-----

[](#usage)

Example of use for this library:

```
