Solved

Pause Execution of ASP

Posted on 2003-12-01
9
280 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 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
The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying 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

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 …
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…

695 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