91亚洲精华国内精华精华液_国产高清在线精品一区不卡_精品特级一级毛片免费观看_欧美日韩中文制服有码_亚洲精品无码你懂的网站369

1、老的curl訪問方式以及耗時統(tǒng)計
<?php
function curl_fetch($url, $timeout=3){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $data = curl_exec($ch);
    $errno = curl_errno($ch);
    if ($errno>0) {
        $data = false;
    }
    curl_close($ch);
    return $data;
}
function microtime_float()
{
   list($usec, $sec) = explode(" ", microtime());
   return ((float)$usec + (float)$sec);
}
$url_arr=array(
     "taobao"=>"http://www.taobao.com",
     "sohu"=>"http://www.sohu.com",
     "sina"=>"http://www.sina.com.cn",
     );
 $time_start = microtime_float();
 $data=array();
 foreach ($url_arr as $key=>$val)
 {
     $data[$key]=curl_fetch($val);
 }
 $time_end = microtime_float();
 $time = $time_end - $time_start;
 echo "耗時:{$time}";
?>
耗時:0.614秒

 

穩(wěn)定

產品高可用性高并發(fā)

貼心

項目群及時溝通

專業(yè)

產品經(jīng)理1v1支持

快速

MVP模式小步快跑

承諾

我們選擇聲譽

堅持

10年專注高端品質開發(fā)
  • 返回頂部