NOVINKA: Najžiadanejšie rekvalifikačné kurzy teraz s 50% zľavou + kurz AI ZADARMO. Nečakaj, táto ponuka dlho nevydrží! Zisti viac:

PHP - sleep

Trieda

Koreň \ Bez triedy

Metóda - sleep

(PHP 4, PHP 5, PHP 7)

The sleep() function stops the script for a given number of seconds.

If it's needed to stop the script for microseconds, the usleep() function can be used.

Procedurálne

  • function sleep (int $seconds) : int

Parametre

NázovDátový typPredvolená hodnotaPopis
$secondsint

The number of seconds to delay the script.

Mávratovej hodnoty

Vracia: int

Returns 0 on success, false on an error.

If the function was interrupted by a signal, returns 192 on Windows (the value of the WAIT_IO_COMPLE­TION constant) and on other operating systems return the number of seconds which left.

Príklady

<?php
echo date('H:i:s');
echo ' - falling asleep...<br />';
sleep(5);
echo 'I am awake! It is ';
echo date('H:i:s');

Súvisiace manuály

      Aktivity