Solved

Pause Execution of ASP

Posted on 2003-12-01
9
275 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
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 properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

773 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