shawnlindstrom / laravel-timer
:description
v0.1.4
2018-12-11 19:50 UTC
Requires
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~7.0
- sempro/phpunit-pretty-print: ^1.0
README
This simple package provides high-resolution, monotonic time when available (PHP >=7.3) for all your timing needs.
Installation
Via Composer
$ composer require shawnlindstrom/laravel-timer
Usage
New up an instance:
$timer = new \shawnlindstrom\Timer; $timer->start(); // do something useful ... $timer->stop(); echo $timer->elapsed(); // default precision is seconds // 2
Elapsed time can be returned in seconds, microseconds, milliseconds, or nanoseconds:
$timer->elapsed(TimeUnit::NANOSECONDS);
Via Facade:
Timer::start(); // do something useful ... Timer::stop(); echo Timer::elapsed(TimeUnit::MICROSECONDS);
Change log
Please see the changelog for more information on what has changed recently.
Testing
composer test
Contributing
Please see contributing.md for details and a todolist.
Security
If you discover any security related issues, please email shawn@tenerant.com instead of using the issue tracker.
Credits
- [Shawn Lindstrom][link-author]
- [All Contributors][link-contributors]
License
MIT. Please see the license file for more information.