驴Hay alguna funci贸n para esperar x tiempo?
Si alguien sabe como se puede esperar un bucle de tiempo antes de ejecutar la siguiente instrucci贸n.
Estoy haciendo en php un:
exec('winword');
//aqui quiero esperar hasta que se abra (aprox 3 segundos) y luego seguir con el c贸digo php
gracias
Estoy haciendo en php un:
exec('winword');
//aqui quiero esperar hasta que se abra (aprox 3 segundos) y luego seguir con el c贸digo php
gracias
sencillo, un bucle "infinito"..........
<?php
function tardate($segundos){
$inicia_en = time();
$termina_en = time()+$segundos;
while(true){
if(time()>$termina_en){
break;
}
}
}
$variable = "hola";
tardate(2); // se tarda 2 segundos !!
$despues_de_dos_segundos_esta_variable_es_igual_a = "mundo";
?>
Saludos... y me avisas qu茅 tal te fue ! :p
<?php
function tardate($segundos){
$inicia_en = time();
$termina_en = time()+$segundos;
while(true){
if(time()>$termina_en){
break;
}
}
}
$variable = "hola";
tardate(2); // se tarda 2 segundos !!
$despues_de_dos_segundos_esta_variable_es_igual_a = "mundo";
?>
Saludos... y me avisas qu茅 tal te fue ! :p
