如何测网络频宽

rocketliu8899 2003-07-04 02:30:04
各位高手:

我现在想测试一台客户机到我的服务器的频宽该如何做啊
效果如:http://www.linkwan.com/gb/broadmeter/SpeedAuto/

做好能给个例子参考

先谢谢了
...全文
188 10 打赏 收藏 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
sports98 2003-07-04
  • 打赏
  • 举报
回复
不会说象我早先碰到的那样吧,非要我用JAVASCRIPT写计数器(这个BT问题我到现在还不晓得咋解决)
sports98 2003-07-04
  • 打赏
  • 举报
回复
有多 BT ?
feyge 2003-07-04
  • 打赏
  • 举报
回复
真BT,公司要我们做得比这个还要BT,还不知怎么做呢!
rocketliu8899 2003-07-04
  • 打赏
  • 举报
回复
文件内的图片也下载到了客户端所以也算在流量内部的
sports98 2003-07-04
  • 打赏
  • 举报
回复
另:
===

我提供的那个,存在一定问题(例如,用户机器装了防火墙禁止ping,或由于区域网络问题),建议使用上面的方法,配合IP库,然后选择有特征的机器(可以是服务器,也可以是用户机器,还可以是你设置的区域应答机),那样显得服务稳定和相对准确多了,但相对来说,投入也就多了很多!
实在不行你可以考虑使用flash然后用里面的ACTION对JS传递数据也行~ GOOD LUCK~
xizi2002 2003-07-04
  • 打赏
  • 举报
回复
这倒没有想到过,不错的问题,关注一下
sports98 2003-07-04
  • 打赏
  • 举报
回复
这样的话,有问题啊

文件内的图片难道不计算在流量中吗?
rocketliu8899 2003-07-04
  • 打赏
  • 举报
回复
我是计算出总的下载的时间,然后:文件大小/时间,但是我的128K专线总是测到130多K
rocketliu8899 2003-07-04
  • 打赏
  • 举报
回复
谢谢了

我现在用JAVASCRIPT.当不准确请帮忙看看是那里的问题:


<html>
<head>
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<title>test speed</title>
</head>
<body>
<script>
tim=1;
setInterval("tim++",100);
b=1;
autourl=new Array();
for(i=1;i<101;i++)
{
autourl[i]="http://dev1.tetra-asia.com/image/work"+i+".gif" ;
}
function butt(){
document.write("<form name=autof>")
for(var i=1;i<autourl.length;i++)
document.write("<input type=text name=txt"+i+" size=10 value=\xb2\xe2\xca\xd4\xd6\xd0\xa1\xad\xa1\xad class=buttonface>==><inp
ut type=text name=url"+i+" size=60 class=buttonface><br>") ^M
document.write("<input type=button value=\xd6\xd8\xd0\xc2\xb2\xe2\xca\xd4\xcb\xd9\xb6\xc8 onclick=top.location=self.location c
lass=buttonface></form>")
}
butt();
function auto(url){
document.autof["url"+b].value=url;
if(tim>2000)
{document.forms[0]["txt"+b].value="\xc1\xb4\xbd\xd3\xb3\xac\xca\xb1"}
else
{
document.autof["txt"+b].value="\xca\xb1\xbc\xe4"+tim/10+"\xc3\xeb";
}
b++;
}

function run()
{
for(var i=1;i<autourl.length;i++)document.write("<img src="+autourl[ i ]+"/"+Math.random()+" width=1 height=1 onerror=auto('"+
autourl[i]+"')>")}
run();
</script>
</body>
</html>
sports98 2003-07-04
  • 打赏
  • 举报
回复
<?php
$size=1024*50;//这里你可以放大到*足够大*以确保数据能尽可能的接近真实
$callnumber=3;
$ip=$_SERVER[REMOTE_ADDR];
list($useca,$seca)=explode(" ",microtime());
@exec("ping -n $callnumber -l $size $ip",$data) or die("Support Forbid!");
list($usecb,$secb)=explode(" ",microtime());
$sec=$secb-$seca;
$msg=$data[count($data)-3];
list($drop,$info)=explode("(",$msg);
list($info,$drop)=explode("%",$info);
$spead=($size*$callnumber-$size*$callnumber*$info/100)/$sec;
echo sprintf("连接速度%.2f(k/s)",$spead/1024);
?>
--------------------------
以上仅仅是个演示,数据可能不准确,但可以给你个思路

21,889

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧