Skip to content

Innmind/TimeWarp

Repository files navigation

TimeWarp

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages