Thread Sleep in Classic ASP?

后端 未结 12 2100
滥情空心
滥情空心 2021-02-05 23:10

I\'m doing some revision on an old app that is written in classic ASP/VbScript.

It has a feature to send out an e-mail to the members of the application, but because the

12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 23:35

    This routine waits any amount of time, and doesn't use CPU:

    Function asp_Wait(nMilliseconds)
      Dim oShell
      '' VBS: Set oShell= Wscript.CreateObject("WScript.Shell")
      '' ASP:
      Set oShell= Server.CreateObject("WScript.Shell")
      Call oShell.run("ping 1.1.1.1 -n 1 -w " & nMilliseconds,1,TRUE) 
      '' Option TRUE: Wait until ping is complete
      '' 1000 milli-second wait is 1 second
    End Function
    

提交回复
热议问题