让服务器执行50万次加法(整数运算)和20万次开方(浮点运算),记录其所使用的时间。 <br/> <% dim i,t1,t2,tempvalue,runtime1,runtime2 '开始计算50万次加法所需时间 t1=timer() for i=1 to 500000 tempvalue= 1 + 1 next t2=timer() runtime1=formatnumber((t2-t1)*1000,2) '开始计算20万次开方所需时间 t1=timer() for i=1 to 200000 tempvalue= 2^0.5 next t2=timer() runtime2=formatnumber((t2-t1)*1000,2)%> <font color=red><%=runtime1%> 毫秒</font> <font color=red><%=runtime2%> 毫秒</font> 在作者自己电脑上的运行结果是让服务器执行50万次加法(整数运算)和20万次开方(浮点运算),记录其所使用的时间。 203.13 毫秒 156.25 毫秒 转载于:https://www.cnblogs.com/CrazyWill/archive/2007/06/22/792578.html