innmind / time-warp
Time warp
Installs: 97 277
Dependents: 7
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
pkg:composer/innmind/time-warp
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-09-18 16:47:31 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 */);