innmind / time-warp
Time warp
4.0.0
2025-04-20 16:28 UTC
Requires
- php: ~8.2
- innmind/immutable: ~5.12
- innmind/time-continuum: ~4.1
- psr/log: ~3.0
Requires (Dev)
- innmind/black-box: ~6.1
- innmind/coding-standard: ~2.0
- innmind/static-analysis: ^1.2.1
This package is auto-updated.
Last update: 2025-04-20 16:29:55 UTC
README
Small library to abstract the way to halt the program.
Installation
composer require innmind/time-warp
Usage
use Innmind\TimeWarp\{ Halt\Usleep, Halt, }; use Innmind\TimeContinuum\Period; function yourApp(Halt $halt): void { // do something $halt(Period::minute(42))->unwrap(); // do some more } yourApp(Usleep::new());
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 */);