Solved

Pause Execution of ASP

Posted on 2003-12-01
9
269 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 50 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
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 set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

705 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

20 Experts available now in Live!

Get 1:1 Help Now