publicfunction delay(s)
SecCount =0
Sec2 =0While SecCount < s +1
Sec1 =Second(Time())
If Sec1 <> Sec2 Then
Sec2 =Second(Time())
SecCount = SecCount +1EndIfWendEnd Function
想这种,,太费CPU了... sleep永远是一个难题!! 我想除了写个asp的dll才能实现么?
发现一个有用的连接
里面说 SQLServer 可以这样Play:
VBScript code
<%
Set conn =CreateObject("ADODB.Connection")
conn.Open ""' indicate a number of seconds, up to 59 sleep =10' make sure timeout doesn't expire! conn.commandTimeout = sleep +5' if you neede more than 59 seconds, you will need to adjust the SQL: sql ="WAITFOR DELAY '00:00:"&right(clng(sleep),2) &"'"
Response.Write(now&"")
conn.Execute sql,,129
Response.Write(now&"")
conn.close: Set conn =Nothing
%>