Ver Mensaje Individual
  #4 (permalink)  
Antiguo 18/10/2011, 02:17
loluchis
 
Fecha de Ingreso: octubre-2011
Mensajes: 37
Antigüedad: 15 años
Puntos: 9
Respuesta: clase cronometro, algo parecido a un timer

Pues creo que lo he solucionado, he visto un script por ahi de como sacar el tiempo lo he adaptado un poco y me salen tiempos mas claros:

Código PHP:
class Cronometro
{

    static private 
$inicio;
    static private 
$fin;

    static public function 
iniciar()
    {
    
$starttime = explode(' ', microtime());
    static::
$inicio = $starttime[1] + $starttime[0];
    }

    static public function 
finalizar()
    {
    
$mtime = explode(' ', microtime());
    static::
$fin = $mtime[0] + $mtime[1] - static::$inicio;
    }

    static public function 
diferencia()
    {
    return static::
$fin;
    }

} 
0.00052499771118164, creo que eso es mas normal, verdad? saludos gracias