2017 © Pedro Peláez
 

library loadtime

Calculate load time of pages or scripts.

image

josantonius/loadtime

Calculate load time of pages or scripts.

  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 10 Versions
  • 4 % Grown

The README.md

PHP LoadTime library

Latest Stable Version License, (*1)

Calculate load time of pages or scripts., (*2)



Requirements

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

Installation

The preferred way to install this extension is through Composer., (*4)

To install PHP LoadTime library, simply:, (*5)

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:, (*6)

composer require Josantonius/LoadTime --prefer-source

You can also clone the complete repository with Git:, (*7)

$ git clone https://github.com/Josantonius/php-Load-time.git, (*8)

Or install it manually:, (*9)

Download LoadTime.php:, (*10)

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

Available Methods

Available methods in this library:, (*11)

- Set initial time

LoadTime::start();

# Return (float) → microtime, (*12)

- Set end time

LoadTime::end();

# Return (float) → seconds, (*13)

- Check if the timer has been started

LoadTime::isActive();

# Return (boolean), (*14)

Quick Start

To use this library with Composer:, (*15)

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

use Josantonius\LoadTime\LoadTime;

Or If you installed it manually, use it:, (*16)

require_once __DIR__ . '/LoadTime.php';

use Josantonius\LoadTime\LoadTime;

Usage

Example of use for this library:, (*17)

<?php
require __DIR__ . '/vendor/autoload.php';

use Josantonius\LoadTime\LoadTime;

LoadTime::start();

for ($i=0; $i < 100000; $i++) { 
    // print_r($i . ' ');
}

print_r('Script executed in: ' . LoadTime::end() . ' seconds.'); 

/* Script executed in: 0.0012 seconds. */

Tests

To run tests you just need composer and to execute the following:, (*18)

git clone https://github.com/Josantonius/php-Load-time.git

cd php-Load-time

composer install

Run unit tests with PHPUnit:, (*19)

composer phpunit

Run PSR2 code standard tests with PHPCS:, (*20)

composer phpcs

Run PHP Mess Detector tests to detect inconsistencies in code style:, (*21)

composer phpmd

Run all previous tests:, (*22)

composer tests

If this project helps you to reduce your development time, you can sponsor me to support my open source work :blush:, (*23)

License

This repository is licensed under the MIT License., (*24)

Copyright © 2017-2022, Josantonius, (*25)

The Versions

06/01 2018

dev-master

9999999-dev

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm page load time script load time

06/01 2018

1.1.7

1.1.7.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm page load time script load time

12/11 2017

1.1.6

1.1.6.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm page load time script load time

02/11 2017

1.1.5

1.1.5.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm page load time script load time

14/09 2017

1.1.4

1.1.4.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

php hhvm page load time script load time

18/07 2017

1.1.3

1.1.3.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

php hhvm page load time script load time

04/07 2017

1.1.2

1.1.2.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

php hhvm page load time script load time

18/03 2017

1.1.1

1.1.1.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

php hhvm page load time script load time

31/01 2017

1.1.0

1.1.0.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

php hhvm page load time script load time

30/01 2017

1.0.0

1.0.0.0

Calculate load time of pages or scripts.

  Sources   Download

MIT

The Requires

  • php >=7.0

 

php hhvm page load time script load time