innmind/time-warp

Time warp

Installs: 97 259

Dependents: 7

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

pkg:composer/innmind/time-warp

4.1.1 2025-08-18 16:25 UTC

This package is auto-updated.

Last update: 2025-09-18 16:47:31 UTC


README

Build Status codecov Type Coverage

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 */);