Created
March 11, 2012 03:30
-
-
Save varemenos/2014877 to your computer and use it in GitHub Desktop.
PHP - Exec time calculation
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
<? | |
// start{ | |
// exec time | |
$start_time = (float) array_sum(explode(' ', microtime())); | |
// } | |
// config file { | |
// developer mode on/off | |
define('DEV_MODE', true); | |
// } | |
// end{ | |
// exec time | |
$end_time = round((float) array_sum(explode(' ', microtime())) - $start_time, 4); | |
if(DEV_MODE){ | |
echo "Exec time: ". $end_time * 1000 ."ms"; | |
} | |
// } | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment