keven/timeout

Execute code within a time limit.

Maintainers

Package info

github.com/kevengodet/timeout

pkg:composer/keven/timeout

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

1.0.0 2019-08-16 22:17 UTC

This package is auto-updated.

Last update: 2026-03-06 07:47:06 UTC


README

Installation

$ composer require keven/timeout

Usage

<?php

use Keven\Timeout\Invoker;

$timeout = new Invoker;

// Execute code in under 2s, or throws an exception
$timeout(function() { sleep(1); return 'ok'; }, 2);