<%
Dim a(10000),i,t
t=Timer
For i=0 to 10000
a(i)=CStr(i)
Next
Response.Write Join(a,vbCrLf)
Response.Write timer-t
Erase a
%>
速度可以和php一拼(虽然还是没有他快)
另一种用法是
s=Join(Array("1","2","3",.....,"9999"))
速度依然比"1" & "2" & "3" & .....& "9999"要快很多
详细测试数据可以看:
//{测试用的客户端模版}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<BODY>
<Script language="VBScript">
dim t
t=timer
</script>
<!--这儿放服务器测试脚本-->
<Script language="VBScript">
document.write "|" & (timer-t) '输出客户端完全接受到所有数据所用的时间
</script>
</BODY>
</HTML>
//{测试的各个脚本的代码}
//--------------------------------------------------
//test-js.asp
//使用数组收集所有的字符窜,最后通过join函数连接起来
//--------------------------------------------------
<script language="JavaScript" RunAt="Server">
var i,t,s;
var a=new Array(10000);
t=(new Date()).getTime();
for(i=0;i<10000;i++){
//s+=String(i)+" ";
a[i]=String(i);
}
s=a.join(" ");
Response.Write(s);
Response.Write("<br>"+String((new Date()).getTime()-t));
a=null;
s=null;
</Script>
//--------------------------------------------------
//--------------------------------------------------
//test-js2.asp
//--------------------------------------------------
<script language="JavaScript" RunAt="Server">
var i,t,s="";
t=(new Date()).getTime();
for(i=0;i<10000;i++){
s+=String(i)+" ";
}
Response.Write(s);
Response.Write((new Date()).getTime()-t);
a=null;
s=null;
</Script>
//--------------------------------------------------
//--------------------------------------------------
//test-js3.asp
//每得到一个数据,立刻输出到数据流中
//--------------------------------------------------
<script language="JavaScript" RunAt="Server">
var i,t;
t=(new Date()).getTime();
for(i=0;i<10000;i++){
Response.Write(i+" ");
}
Response.Write("<br>");
Response.Write((new Date()).getTime()-t);
</Script>
//--------------------------------------------------
//--------------------------------------------------
//test-js3.asp
//这个程序通过建立零时文件,并将所有内容输入到文件中,最后统一输出
//建立零时文件所用的组件是FSO
//--------------------------------------------------