usleep 


php apg

DELAYS the program executions by a given number of  µs, (microseconds) .



<?php

void usleep 
int $microseconds )


where,

$microseconds Number of microseconds to delay the program execution
  
?>

 $microseconds 


Number of  µseconds , (microseconds), to delay the program execution.





1000000 µseconds = 1 second.

This function will generate a:

Warning: ... in PHP 7.4.XX
or
Fatal error: ... in PHP 8.0.XX,

if the provided number of µseconds is negative.



  1 EXERCISE   

<?php

$lang 
'en';

$str_tzg date_default_timezone_get();

$pt 'Fuso horário atual:<br>';
$en 'Current Time Zone:<br>';
$jp 'タイムゾーンセット:<br>';

echo 
'<br>' . $$lang  '&nbsp;' $str_tzg '<br><br>';

echo 
date("l F d Y H:i:s");
echo 
'<br><br>';

$microtime2sleep 3000000;

// Delays the execution time by: 
// 3000000 µseconds = 3 seconds

usleep($microtime2sleep);

echo 
date("l F d Y H:i:s");

?>