src/utils.php
/**
 * Returns a promise that is resolved after x seconds.
 * Useful for giving back control to the event loop inside a coroutine.
 *
 * @param int $seconds
 * @return Promise <void>
 */
Returns a promise that is resolved after x seconds.
Useful for giving back control to the event loop inside a coroutine.

@param int $seconds
@return Promise 
Returns a promise that is resolved after x seconds . Useful for giving back control to the event loop inside a coroutine . @param int $seconds @return Promise
function timeout($seconds = 0): Promise
{
    $promise = new Promise;
    Loop\setTimeout([$promise, 'fulfill'], $seconds);
    return $promise;
}
function timeout ( $ seconds = 0 ) : Promise { $ promise = new Promise ; Loop \ setTimeout ( [ $ promise , 'fulfill' ] , $ seconds ) ; return $ promise ; }
Returns a promise that is resolved after x seconds.
Returns a promise that is resolved after x seconds .