?
Solved

Pause Execution of ASP

Posted on 2003-12-01
9
Medium Priority
?
282 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 

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

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

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

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
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 manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…
Suggested Courses

801 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