Пример #1
0
 /**
  * @param int   $timeout
  * @param mixed $resolve
  *
  * @return \generator
  */
 public static function delay(int $timeout, $resolve = null) : \generator
 {
     $timeout = self::ms2s($timeout);
     yield from self::wait(microtime(true), $timeout);
     return runtime::await($resolve);
 }