Need a simple behind the scenes counter to use as a pause for an asp page

Is there a simple way to pause an ASP page? I'm thinking maybe having a simple VB6 dll  i could call from an ASP page so the processor doesn't get pinned.

i'm currently using
Sub Sleep(intSeconds)
    dteStart = Time()
    dteEnd = DateAdd("s", intSeconds, dteStart)
    While dteEnd > Time()
End Sub

Open in new window

This works fine seeing as the page runs locally on a kiosk, the only problem is that the loader image i'm using won't paint... processors go to 50% each and the page basically comes back to life after the delay has expired.

can someone provide a simple bit-o-code for this vb timer i'm thinking of or give a better solution
Who is Participating?
käµfm³d 👽Connect With a Mentor Commented:

So you know, the Sleep() API function causes the thread calling it to sleep, allowing other threads to continue processing. It is designed to allow the processor to do other work while some thread is sleeping.
käµfm³d 👽Commented:
Have you considered using the sleep API function?
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)



' If this is an int like '5', then multiply by 1000 because Sleep() expects milliseconds to sleep. e.g.

Sleep(intSeconds * 1000)

Open in new window

ArkConnect With a Mentor Commented:
>>having a simple VB6 dll <<   
It is not necessary to invent a bicycle. Such dll already exists:
<script language="VBScript">
      set WshShell = WScript.CreateObject("WScript.Shell")
      WScript.Sleep 1000 'sleep 1 sec
<script language="JScript">
      var WshShell = WScript.CreateObject("WScript.Shell");
If WScript.Sleep won't work with ASP, you can use;
<script language="VBScript">
Sub Delay( seconds )
    Dim wshShell
    Set wshShell = CreateObject( "WScript.Shell" )
    wshShell.Run "ping -n " & ( seconds + 1 ) & "", 0, True
    Set wshShell = Nothing
End Sub
cyberdyne_devAuthor Commented:
where and how would i use the API function? example please
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.