Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Pause Execution of ASP

Posted on 2003-12-01
9
Medium Priority
?
286 Views
Last Modified: 2011-09-20
Hi,

         I need to pause the execution of an ASP for some time -say 2 sec (or for any duration)-
Is there any method otherthan giving a Dummy loop like

             for intJ=1 to 25000
            x=(x+9*10/2*13-133+1233/12332*1231)
            x=x-(9*10/2*13-133+1233)
      next

Thanks In advance to all

Arshad
0
Comment
Question by:arshadkollath
  • 2
  • 2
  • 2
  • +1
9 Comments
 
LVL 33

Accepted Solution

by:
hongjun earned 200 total points
ID: 9858176
There isn't a Sleep/sleep function in ASP.
You can use a component (free)
WaitFor 1.0
http://www.serverobjects.com/products.htm#free

hongjun
0
 
LVL 4

Expert Comment

by:c_swanky
ID: 9872728
Hongjun's right.....

see mattyk's code below  (http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_11973538.html?query=delay+timeout&searchType=topic)

<%
dim startTimer,currentTimer
dim duration 'in seconds
duration=30

startTimer=timer
do while currentTimer<(starttimer+duration)
     currentTimer=timer
Loop
%>
0
 
LVL 33

Expert Comment

by:hongjun
ID: 9872734
A loop will work provided you are able to accept your CPU being "eaten" 100%.

hongjun
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

Expert Comment

by:ypocat
ID: 10081819
Few lines to solve this problem:

create proc sleep @time datetime
as
    WAITFOR DELAY @time
go

Sub Wait(seconds)
    dim wait_date
    wait_date = dateadd("s", seconds, 0)
    call SafeExecute(DBConn, "sleep '" & hour(wait_date) & ":" & minute(wait_date) & ":" & second(wait_date) & "'")
End Sub
0
 

Expert Comment

by:ypocat
ID: 10081833
...and of course replace "SafeExecute(DBConn" with your own call to ADO... :-)
0
 
LVL 2

Expert Comment

by:danalmar
ID: 10180413
oneother free component: aspTime

http://www.kamath.com/downloads/
0
 
LVL 2

Expert Comment

by:danalmar
ID: 10180434
aspTime Example:

<%
' Create an instance of Time Class
Set X = Server.CreateObject("ASPTime.Time")
' Start the stop-clock
X.Start()
'Your code goes here
.........
' Pause for 1.25 second
X.Pause(1.25)
' Stop the stop-clock
X.Stop()
' Print the TimeGap
Response.Write ("The code clocked " & X.TimeGap & " MilliSeconds")
%>

it seems easy to manipulate.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When deciding to adopt any help desk solutions many factors should be explored before taking decisions. This will change from business to another but in general there are some kind of rule of thumb. Here are some quick tips: Do we need only ticket…
In this short web based tutorial, I wanted to show users how they can still use the powers of FrontPage in conjunction with Expression Web 3.  Even though Microsoft eliminated the use of Web components, we can still use them with FrontPage and edit …
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

926 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