Last active
September 12, 2016 12:45
-
-
Save caionitro/313e27124d7713c91a82c294f5a3348d to your computer and use it in GitHub Desktop.
script para medir o tempo gasto do arquivo/sistema.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$time = microtime(TRUE); | |
function formatPeriod($endtime, $starttime) | |
{ | |
$duration = $endtime - $starttime; | |
$hours = (int) ($duration / 60 / 60); | |
$minutes = (int) ($duration / 60) - $hours * 60; | |
$seconds = (int) $duration - $hours * 60 * 60 - $minutes * 60; | |
return ($hours == 0 ? "00":$hours).":".($minutes == 0 ? "00":($minutes < 10? "0".$minutes:$minutes)).":".($seconds == 0 ? "00":($seconds < 10? "0".$seconds:$seconds)); | |
} | |
//SCRIPT PHP A SER PROCESSADO | |
echo formatPeriod(microtime(TRUE),$time); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment