<%
Const DataSize=100 '测试数据量,单位K,值越大,测试越精确,但速度越慢,推荐值100K左右
Response.Buffer=false [转自:飞腾设计网 http://www.feitec.com]
oneK=String(1024,"A")
TotalData=""
for i=1 to DataSize
TotalData=TotalData & oneK
next
Response.write "<html><head><title>速度测试程序</title></head><body>"
Response.write "<form name=form1><span align=center><input type=text id=Info size=30 value="/"速度测试中,请稍候.."" ReadOnly><input type=button name=reload value=""重新测试"" onClick=""location.reload();""></span></form>"
Response.write "<script language=javascript>function formatNumber(nu) { num=Math.floor(nu*100);num=num/100;return num;}</script>"
Response.write "<script language=javascript>var beginTime=new Date();</script><!--"
Response.write TotalData
Response.write "--><script language=javascript>var endTime=new Date();allTime=endTime.getTime()-beginTime.getTime();allTime=allTime / 1000;speed=formatNumber(" & DataSize & "/ allTime);document.getElementById(""Info"").value='连接到XX机房的速度:'+speed+'K/S';</script>"
Response.write "</body></html>"
%>