高难!高难!!! http://www.csdn.net/expert/topic/982/982294.xml?temp=2.750796E-02里面有一个计算速度的.你看看吧. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 class timer{ var $StartTime = 0; var $StopTime = 0; var $TimeSpent = 0; function start() { $this->StartTime = microtime(); } function stop() { $this->StopTime = microtime(); } function spent() { if ($this->TimeSpent) { return $this->TimeSpent; } else { $StartMicro = substr($this->StartTime,0,10); $StartSecond = substr($this->StartTime,11,10); $StopMicro = substr($this->StopTime,0,10); $StopSecond = substr($this->StopTime,11,10); $start = doubleval($StartMicro) + $StartSecond; $stop = doubleval($StopMicro) + $StopSecond; $this->TimeSpent = $stop - $start; return substr($this->TimeSpent,0,8); } } // end function spent();} //end class timer;$timer = new timer;$timer->start();$timer->stop();echo "运行时间花了".$timer->spent()."秒<br>"; html文字正常,JavaScript输出中文乱码问题 问一个极其小白的问题->select返回一列所有记录 数组比较问题 如何制定PHP学习计划 求忽略HTML标签的替换字符串正则表达式 没有版主吗?建议广告贴和招聘贴一律删! eregi_replace()的用法 一个页面转向的方法提问 我做了个社区在php3下调试通过,不知道在php4.0下是否可以使用?? 同一个浏览器的UA(user-agent)在变化么? session_start()问题?急 在线求助
{
var $StartTime = 0;
var $StopTime = 0;
var $TimeSpent = 0; function start()
{
$this->StartTime = microtime();
}
function stop()
{
$this->StopTime = microtime();
}
function spent()
{
if ($this->TimeSpent)
{
return $this->TimeSpent;
}
else
{
$StartMicro = substr($this->StartTime,0,10);
$StartSecond = substr($this->StartTime,11,10);
$StopMicro = substr($this->StopTime,0,10);
$StopSecond = substr($this->StopTime,11,10);
$start = doubleval($StartMicro) + $StartSecond;
$stop = doubleval($StopMicro) + $StopSecond;
$this->TimeSpent = $stop - $start;
return substr($this->TimeSpent,0,8);
}
} // end function spent();
} //end class timer;
$timer = new timer;
$timer->start();
$timer->stop();
echo "运行时间花了".$timer->spent()."秒<br>";