Tema: Error comico
Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/06/2003, 16:40
Cluster
O_O
 
Fecha de Ingreso: enero-2002
Ubicación: Santiago - Chile
Mensajes: 34.417
Antigüedad: 22 años, 3 meses
Puntos: 129
mm porqué tienes tu } else { ahí?

Osese .. defines la función getmicrotime() si $x==1 .. obtienes el valor de inicio (tiempo ..) ..

Pero luego haces "si no es $x==1" (el }else{ .. ) coges el tiempo del $tiempo_fin = getmicrotime(); .. y haces tu calculo para obtener el tiempo invertido .. (la resta) ..

Esto:
Código PHP:
function getmicrotime() {  
    list(
$usec$sec) = explode(" ",microtime());  
    return ((float)
$usec + (float)$sec);  


$tiempo_inicio getmicrotime(); 
deberías tenerlo fuera de tu if ($x==1)

Y

Código PHP:
$tiempo_fin getmicrotime(); 
$tiempo_total round($tiempo_fin $tiempo_inicio,3); 
echo <
br><font size='1' face='Verdana'>Generacion de página en$tiempo_total segundos <br>"; 
fuera de tu IF ($x==1) { ...} else {... } .. aquí


Un saludo,
__________________
Por motivos personales ya no puedo estar con Uds. Fue grato haber compartido todos estos años. Igualmente los seguiré leyendo.