开发者

How to calculate time required by PHP file to open using wget?

开发者 https://www.devze.com 2023-04-11 23:08 出处:网络
I want to find out the time required by a php file to open(download) inside a Perl script.开发者_开发技巧 I want to use wget here.You could use microtime to calculate the time:

I want to find out the time required by a php file to open(download) inside a Perl script.开发者_开发技巧 I want to use wget here.


You could use microtime to calculate the time:

/**
 * Simple function to replicate PHP 5 behaviour
 */
function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return ((float)$usec + (float)$sec);
}

$time_start = microtime_float();

// do stuff

$time_end = microtime_float();
$time = $time_end - $time_start;

echo "Execution time was $time seconds\n";
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号