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,