ORIENT/vendor/phpunit/php-timer
merdan ac002c1ac1 reklama 2021-04-08 13:08:59 +05:00
..
.github reklama 2021-04-08 13:08:59 +05:00
src reklama 2021-04-08 13:08:59 +05:00
tests reklama 2021-04-08 13:08:59 +05:00
.gitattributes reklama 2021-04-08 13:08:59 +05:00
.gitignore reklama 2021-04-08 13:08:59 +05:00
.php_cs.dist reklama 2021-04-08 13:08:59 +05:00
.travis.yml reklama 2021-04-08 13:08:59 +05:00
ChangeLog.md reklama 2021-04-08 13:08:59 +05:00
LICENSE reklama 2021-04-08 13:08:59 +05:00
README.md reklama 2021-04-08 13:08:59 +05:00
build.xml reklama 2021-04-08 13:08:59 +05:00
composer.json reklama 2021-04-08 13:08:59 +05:00
phpunit.xml reklama 2021-04-08 13:08:59 +05:00

README.md

Build Status

phpunit/php-timer

Utility class for timing things, factored out of PHPUnit into a stand-alone component.

Installation

You can add this library as a local, per-project dependency to your project using Composer:

composer require phpunit/php-timer

If you only need this library during development, for instance to run your project's test suite, then you should add it as a development-time dependency:

composer require --dev phpunit/php-timer

Usage

Basic Timing

use SebastianBergmann\Timer\Timer;

Timer::start();

// ...

$time = Timer::stop();
var_dump($time);

print Timer::secondsToTimeString($time);

The code above yields the output below:

double(1.0967254638672E-5)
0 ms

Resource Consumption Since PHP Startup

use SebastianBergmann\Timer\Timer;

print Timer::resourceUsage();

The code above yields the output below:

Time: 0 ms, Memory: 0.50MB