innmind / time-warp
Time warp
3.0.0
2022-02-06 10:27 UTC
Requires
- php: ~8.0
- innmind/time-continuum: ~3.0
- psr/log: ~3.0
Requires (Dev)
- innmind/coding-standard: ~2.0
- phpunit/phpunit: ~9.0
- vimeo/psalm: ~4.1
This package is auto-updated.
Last update: 2024-11-06 16:01:18 UTC
README
Small lib to abstract the way to halt the program.
Currently this library is only usable on Earth, DO NOT use it on Mars or anywhere else in the universe.
Installation
composer require innmind/time-warp
Usage
use Innmind\TimeWarp\{ Halt\Usleep, Halt, }; use Innmind\TimeContinuum\Earth\Period\Minute; function yourApp(Halt $halt): void { // do something $halt(new Minute(42)); // do some more } yourApp(new Usleep);
This example will halt your program for 42 minutes.
Logging
use Innmind\TimeWarp\Halt\Logger; use Psr\Log\LoggerInterface; $halt = Logger::psr($halt, /** an instance of LoggerInterface */);