Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?PHP
- function microtime_float(){
- list($useg, $seg) = explode(" ", microtime());
- return ((float)$useg + (float)$seg);
- }
- $tiempo_inicio = microtime_float();
- /* inicio del algoritmo de ordenación */
- /* aqui va el algoritmo a observar*/
- /* Fin del algoritmo de ordenación */
- $tiempo_fin = microtime_float();
- $tiempo = $tiempo_fin - $tiempo_inicio;
- echo "Tiempo empleado: " . ($tiempo_fin - $tiempo_inicio);
- ?>
- 1 2 3 4 5 Tiempo empleado: 4.8160552978516
- 1 2 3 4 5 Tiempo empleado: 3.0994415283203
- 1 2 3 4 5 Tiempo empleado: 9.0122222900391
- 1 2 3 4 5 Tiempo empleado: 5.5074691772461
- etc, etc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement