欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

fsockopen,fopen,file_get_contents 为啥fsockopen是最快的呢

程序员文章站 2022-05-24 12:05:18
...
fsockopen,fopen,file_get_contents 为什么fsockopen是最快的呢
query_time_class.inc.php

    class query_time_class{

var $start_time;
var $end_time;

function query_start(){

$this->start_time = 0;
$this->end_time = 0;
$this->start_time = $this->get_cur_sec();

}

function query_end(){

$this->end_time = $this->get_cur_sec();

}

function get_query_time(){

$time = floatval($this->end_time - $this->start_time);
$time = sprintf("%01.4f",$time);
return $time;

}

function get_cur_sec(){

list($msec,$sec) = explode(" ", microtime());
$msec = floatval($msec);
$sec = floatval($sec+$msec);
return $sec;

}
function out_put(){

$time = $this->get_query_time();
$output = "执行时间 {$time} 秒";
echo $output;

}

}


?>



执行代码
fsockopen,fopen,file_get_contents  为啥fsockopen是最快的呢

声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。

相关文章

相关视频