| px | top | add code | search | signup | login | help |
<?php // PHP parsing starts here.
function getmicrotime() { // declares the function getmicrotime.
list($usec, $sec) = explode(" ",microtime()); // please refer to the individual explanation.
return ((float)$usec + (float)$sec); // please refer to the individual explanation.
}
$time_start = getmicrotime(); // start of variable declaration.
for ($i=0; $i < 1000; $i++) { // do nothing, 1000 times
}
$time_end = getmicrotime(); // start of variable declaration.
$time = $time_end - $time_start; // please refer to the individual explanation.
echo "Script executed in $time seconds"; // display the result.
?>
Comments or questions?
PX is running PHP 5.2.11
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.