array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'function.time-sleep-until.php', 1 => 'time_sleep_until', 2 => 'Make the script sleep until the specified time', ), 'up' => array ( 0 => 'ref.misc.php', 1 => 'Функції Misc.', ), 'prev' => array ( 0 => 'function.time-nanosleep.php', 1 => 'time_nanosleep', ), 'next' => array ( 0 => 'function.uniqid.php', 1 => 'uniqid', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/misc/functions/time-sleep-until.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>

time_sleep_until

(PHP 5 >= 5.1.0, PHP 7, PHP 8)

time_sleep_until Make the script sleep until the specified time

Опис

time_sleep_until(float $timestamp): bool

Makes the script sleep until the specified timestamp.

Параметри

timestamp

The timestamp when the script should wake.

Значення, що повертаються

Повертає true у разі успіху або false в разі помилки.

Помилки/виключення

If the specified timestamp is in the past, this function will generate a E_WARNING.

Приклади

Приклад #1 A time_sleep_until() example

<?php

//returns false and generates a warning
var_dump(time_sleep_until(time()-1));

// may only work on faster computers, will sleep up to 0.2 seconds
var_dump(time_sleep_until(microtime(true)+0.2));

?>

Примітки

Зауваження: All signals will be delivered after the script wakes up.

Прогляньте також