<%
starttime=timer()
a=1
for i=1 to 100000
a=a+i
next
'页内其它代码,以上只是用作测试
response.write "页面执行时间:"&(timer()-starttime)*1000&"毫秒"
%>
博客展示了一段ASP代码用于测试页面执行时间。通过timer函数记录起始时间,执行一个循环操作后,再用timer函数获取结束时间,计算差值并乘以1000得到页面执行时间(毫秒)。
<%
starttime=timer()
a=1
for i=1 to 100000
a=a+i
next
'页内其它代码,以上只是用作测试
response.write "页面执行时间:"&(timer()-starttime)*1000&"毫秒"
%>
1万+
1459