Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/05/2007, 05:42
Avatar de jerkan
jerkan
 
Fecha de Ingreso: septiembre-2005
Mensajes: 1.607
Antigüedad: 21 años, 1 mes
Puntos: 19
Re: Usar microtime() para medir tiempo?

Encontré esto buscando por google:
Código PHP:
<!-- Ubicar este script al comienzo de la página -->
<?php
$mtime 
= microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$tiempoinicial = $mtime;
;
?>
<!-- Comienzo del código del Sitio -->
<html>
...
</html>
<!-- Ubicar este script al final de la página -->
<?php
$mtime 
= microtime();
$mtime = explode(" ",$mtime);
$mtime = $mtime[1] + $mtime[0];
$tiempofinal = $mtime;
$tiempototal = ($tiempofinal - $tiempoinicial);
echo 
"La página fue creada en ".$tiempototal." segundos";
?>