ASP time delay script

I thought I would post this function I wrote to do a simple time delay on an ASP script. It’s pretty straight forward.

Function:
Sub Pause(intSeconds)
startTime = Time()
Do Until DateDiff(“s”, startTime, Time(), 0, 0) > intSeconds
Loop
End Sub

Call Function:
Pause(5)

Now before you start complaining, I know this is not a great solution. There can be resource issues on your server, because all this function does is loop. With that being said, there are certain cases where this script can come in handy. Some outgoing mail servers require a short delay between emails to prevent spam. I used this script on a credit card processing program I wrote. If the merchant company failed to respond to my authorization request the script would pause for 5 seconds before trying again. I would try 5 times before dumping to an error message.

Enjoy!