parse times?
Posted: Fri Jan 23, 2004 7:23 am
i have heard alot of people talking about how fast there scripts parse in like 0.14 seconds etc.
just wanted to ask how you can find out?
just wanted to ask how you can find out?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$start_time = time();
//lines of code
//lines of code
//lines of code
//lines of code
//lines of code
//lines of code
$end = round(time() - $start_time, 3);
echo "Page parsed in ". $end." secs";
?>Code: Select all
<?php
function getmicrotime() {
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
$time_start = getmicrotime();
for ($i=0; $i < 1000; $i++){
// do nothing, 1000 times
}
$time_end = getmicrotime();
$time = $time_end - $time_start;
echo "Did nothing in $time seconds\n";
?>