2017 © Pedro Peláez
 

library php-timer

Utility class for timing

image

izabolotnev/php-timer

Utility class for timing

  • Thursday, March 24, 2016
  • by izabolotnev
  • Repository
  • 1 Watchers
  • 1 Stars
  • 1,819 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 43 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

Build Status, (*1)

Timer

Utility class for timing things, (*2)

Installation

To add this package as a local, per-project dependency to your project, simply add a dependency on izabolotnev/php-timer to your project's composer.json file. Here is a minimal example of a composer.json file that just defines a dependency on Timer:, (*3)

{
    "require": {
        "izabolotnev/php-timer": "~2.1"
    }
}

Usage

Basic Timing

use izabolotnev\Timer;

Timer::start();

// ...

$time = Timer::stop();

print Timer::secondsToTimeString($time);

or, (*4)

use izabolotnev\Timer;

Timer::start();

// ...

print Timer::stopAndFormat();

The code above yields the output below:, (*5)

0 ms.

Advanced usage

use izabolotnev\Timer;

Timer::addNewTimer('myTimer');
Timer::start();

sleep(2);

Timer::start('myTimer');
echo 'Default: ', Timer::stopAndFormat(), PHP_EOL;

sleep(3);

echo 'Custom: ', Timer::stopAndFormat('myTimer'), PHP_EOL;

The code above yields the output below:, (*6)

Default: 2 s.
Custom: 3 s.

The Versions

24/03 2016

dev-master

9999999-dev https://github.com/izabolotnev/php-timer/

Utility class for timing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Ilya Zabolotnev

timer

24/03 2016

2.1

2.1.0.0 https://github.com/izabolotnev/php-timer/

Utility class for timing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Ilya Zabolotnev

timer

11/12 2015

2

2.0.0.0 https://github.com/izabolotnev/php-timer/

Utility class for timing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.4

 

The Development Requires

by Ilya Zabolotnev

timer

21/06 2015

1.0.7

1.0.7.0 https://github.com/sebastianbergmann/php-timer/

Utility class for timing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.3

 

timer

13/06 2015

1.0.6

1.0.6.0 https://github.com/sebastianbergmann/php-timer/

Utility class for timing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.3

 

timer

02/08 2013

1.0.5

1.0.5.0 https://github.com/sebastianbergmann/php-timer/

Utility class for timing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.3

 

timer

11/10 2012

1.0.4

1.0.4.0 http://www.phpunit.de/

Utility class for timing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.3.3

 

timer

23/09 2012

1.0.3

1.0.3.0 http://www.phpunit.de/

Utility class for timing

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.2.7

 

timer