downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/function.time-sleep-until.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/ref.misc.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'function.time-sleep-until.php',
   
1 => 'time_sleep_until',
  ),
 
'up' =>
  array (
   
0 => 'ref.misc.php',
   
1 => 'Misc. Functions',
  ),
 
'prev' =>
  array (
   
0 => 'function.time-nanosleep.php',
   
1 => 'time_nanosleep',
  ),
 
'next' =>
  array (
   
0 => 'function.uniqid.php',
   
1 => 'uniqid',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="function.time-sleep-until" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">time_sleep_until</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0)</p><p class="refpurpose"><span class="refname">time_sleep_until</span> &mdash; <span class="dc-title">
   Make the script sleep until the specified time
  </span></p>

 </div>

 <a name="function.time-sleep-until.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><b>time_sleep_until</b></span>
    ( <span class="methodparam"><span class="type">float</span> <tt class="parameter">$timestamp</tt></span>
   )</div>

  <p class="para rdfs-comment">
   Makes the script sleep until the specified
   <i><tt class="parameter">timestamp</tt></i>
.
  </p>
 </div>


 <a name="function.time-sleep-until.parameters"></a><div class="refsect1 parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   </p><dl>

    <dt class="varlistentry">

     <span class="term"><i><tt class="parameter">timestamp</tt></i>
</span>

     </dt><dd class="listitem">

      <p class="para">
       The timestamp when the script should wake.
      </p>
     </dd>

   
   </dl>
<p>
  </p>
 </div>


 <a name="function.time-sleep-until.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <b><tt class="constant">TRUE</tt></b> on success or <b><tt class="constant">FALSE</tt></b> on failure.
  </p>
 </div>

 
 <a name="function.time-sleep-until.changelog"></a><div class="refsect1 changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   </p><table class="doctable informaltable">
   
     <thead valign="middle">
      <tr valign="middle">
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody valign="middle" class="tbody">
      <tr valign="middle">
       <td align="left">5.3.0</td>
       <td align="left">
        This function is now available on Windows platforms.
       </td>
      </tr>

     </tbody>
   
   </table>
<p>
  </p>
 </div>


 <a name="function.time-sleep-until.errors"></a><div class="refsect1 errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="para">
   If the specified <i><tt class="parameter">timestamp</tt></i>
 is in the past, this
   function will generate a <b><tt class="constant">E_WARNING</tt></b>.
  </p>
 </div>


 <a name="function.time-sleep-until.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 A <b>time_sleep_until()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">//returns&nbsp;false&nbsp;and&nbsp;generates&nbsp;a&nbsp;warning<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">time_sleep_until</span><span style="color: #007700">(</span><span style="color: #0000BB">time</span><span style="color: #007700">()-</span><span style="color: #0000BB">1</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">//&nbsp;may&nbsp;only&nbsp;work&nbsp;on&nbsp;faster&nbsp;computers,&nbsp;will&nbsp;sleep&nbsp;up&nbsp;to&nbsp;0.2&nbsp;seconds<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">time_sleep_until</span><span style="color: #007700">(</span><span style="color: #0000BB">microtime</span><span style="color: #007700">(</span><span style="color: #0000BB">true</span><span style="color: #007700">)+</span><span style="color: #0000BB">0.2</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div><p>
  </p>
 </div>


 <a name="function.time-sleep-until.notes"></a><div class="refsect1 notes">
  <h3 class="title">Notes</h3>
  <blockquote><p><b class="note">Note</b>:
   <span class="simpara">
    All signals will be delivered after the script wakes up.
   </span>
  </p></blockquote>
 </div>


 <a name="function.time-sleep-until.seealso"></a><div class="refsect1 seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   </p><ul class="simplelist">
    <li class="member"><a href="function.sleep.php" class="function" rel="rdfs-seeAlso">sleep()</a> - Delay execution</li>
    <li class="member"><a href="function.usleep.php" class="function" rel="rdfs-seeAlso">usleep()</a> - Delay execution in microseconds</li>
    <li class="member"><a href="function.time-nanosleep.php" class="function" rel="rdfs-seeAlso">time_nanosleep()</a> - Delay for a number of seconds and nanoseconds</li>
    <li class="member"><a href="function.set-time-limit.php" class="function" rel="rdfs-seeAlso">set_time_limit()</a> - Limits the maximum execution time</li>
   </ul><p>
  </p>
 </div>

</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites