Efficiency source HDD Bad channel detection software PHP address reference PHP address efficiency issues

Source: Internet
Author: User
Tags time 0
Copy the Code code as follows:


Echo ' Begin time: '. $begin =microtime (false). '
';//begin to count time
$array =array ();
for ($i =1; $i <=10000; $i + +) {//produce a very Large array
$array [$i]= $i;
}
/*
$arr = $array;//copy copy and print total time 0.02
foreach ($arr as $ar) {
echo $ar. '
';
}
*/
/*
$newarr =& $array;//Address reference time is always controlled within 0.01 the advantages of address references are reflected
foreach ($newarr as $r) {
echo $r. '
';
}
*/
foreach ($array as $a) {//Basic is 0.02 is rarely 0.01 why is there no address reference fast? Wonder
echo $a. '
';
}
Echo ' End time: '. $end =microtime (false). '
';//end to count time
Echo ' Total time: '. ($end-$begin);
?>

The above describes the efficiency source hard drive bad detection software PHP address reference PHP address reference efficiency issues, including the efficiency of the source hard drive bad detection software content, I hope that the PHP tutorial interested friends helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.