keven/timeout

Execute code within a time limit.

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/keven/timeout

1.0.0 2019-08-16 22:17 UTC

This package is auto-updated.

Last update: 2025-10-06 07:02:32 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);