Solved

5 seconds delay in classic ASP

Posted on 2009-04-08
2
3,010 Views
Last Modified: 2012-05-06
Hello guys,

I need an ASP file to perform a 5 seconds delay and read that database, until a field called STATUS equals to 10.

For example:

Do until Status=10
     Select STATUS from database
     status=database result
     5 SECONDS WAIT
loop

I want to put that 5 seconds wait before the database is queried again, so I don't overload the SQL server.

Thanks.
0
Comment
Question by:pvg1975
2 Comments
 
LVL 13

Accepted Solution

by:
ylandrum earned 500 total points
ID: 24104171
From http://www.aspfree.com/c/a/ASP-Code/Time-Delay-function-by-Michael-Wright/

<%
Sub Delay(DelaySeconds)
SecCount = 0
Sec2 = 0
While SecCount < DelaySeconds + 1
Sec1 = Second(Time())
If Sec1 <> Sec2 Then
Sec2 = Second(Time())
SecCount = SecCount + 1
End If
Wend
End Sub
%>

To call the function (sub):


Delay(The delay time)
E.g.

<% Delay(2) %>
0
 

Author Closing Comment

by:pvg1975
ID: 31568388
Thanks Ylandrum! It is working PERFECT!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now