<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.swoole-timer.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'swoole-timer.after.php',
    1 => 'Swoole\\Timer::after',
    2 => 'Execute a function after a specified time',
  ),
  'up' => 
  array (
    0 => 'class.swoole-timer.php',
    1 => 'Swoole\\Timer',
  ),
  'prev' => 
  array (
    0 => 'class.swoole-timer.php',
    1 => 'Swoole\\Timer',
  ),
  'next' => 
  array (
    0 => 'swoole-timer.clear.php',
    1 => 'Swoole\\Timer::clear',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/swoole/swoole/timer/after.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="swoole-timer.after" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Swoole\Timer::after</h1>
  <p class="verinfo">(PECL swoole &gt;= 1.9.0)</p><p class="refpurpose"><span class="refname">Swoole\Timer::after</span> &mdash; <span class="dc-title">Execute a function after a specified time</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-swoole-timer.after-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="modifier">function</span> <span class="methodname"><strong>Swoole\Timer::after</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$ms</code></span>, <span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>, <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">...$params</code></span>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   Creates a one-shot timer, which is destroyed once its callback has run.
   Unlike <span class="function"><a href="function.sleep.php" class="function">sleep()</a></span>, it does not block the current process.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-swoole-timer.after-parameters">
  <h3 class="title">Параметри</h3>
  <dl>
   
    <dt><code class="parameter">ms</code></dt>
    <dd>
     <p class="simpara">
      The delay in milliseconds. Must be greater than or equal to
      <code class="literal">1</code>; a lower value emits an <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>
      and the call fails.
     </p>
    </dd>
   
   
    <dt><code class="parameter">callback</code></dt>
    <dd>
     <p class="simpara">
      The function to execute once the delay has elapsed. It is called as
      <code class="literal">callback(mixed ...$params)</code>. Unlike
      <span class="methodname"><a href="swoole-timer.tick.php" class="methodname">Swoole\Timer::tick()</a></span>, the timer ID is not passed
      to the callback.
     </p>
    </dd>
   
   
    <dt><code class="parameter">params</code></dt>
    <dd>
     <p class="simpara">
      Additional values passed to <code class="parameter">callback</code>.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-swoole-timer.after-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="simpara">
   Returns the timer ID, which can be passed to
   <span class="methodname"><a href="swoole-timer.clear.php" class="methodname">Swoole\Timer::clear()</a></span> to cancel the timer before it
   fires. Returns <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if the timer could not be created, in particular when
   <code class="parameter">ms</code> is less than <code class="literal">1</code>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-swoole-timer.after-examples">
  <h3 class="title">Приклади</h3>
  <div class="example" id="example-1">
   <p><strong>Приклад #1 <span class="function"><strong>Swoole\Timer::after()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
Swoole\Timer</span><span style="color: #007700">::</span><span style="color: #0000BB">after</span><span style="color: #007700">(</span><span style="color: #0000BB">1000</span><span style="color: #007700">, function (</span><span style="color: #0000BB">string $name</span><span style="color: #007700">) {
    echo </span><span style="color: #DD0000">"Hello, </span><span style="color: #0000BB">$name</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;
}, </span><span style="color: #DD0000">"Swoole"</span><span style="color: #007700">);
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>Поданий вище приклад
виведе:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Hello, Swoole</pre>
</div>
   </div>
  </div>
 </div>

</div><?php manual_footer($setup); ?>