Click to See Complete Forum and Search --> : Pause for a 1/100 or maybe even 1/1000 of a second


AndyK
September 28th, 1999, 05:12 PM
this code

Sub Pause(interval)

Current = Timer
Do While Timer - Current < Val(interval)
DoEvents
Loop
End Sub



that I picked up somewhere on internet is sucky, it stops like for longer then I need it to, even if I use Pause 0.001 it stops same as long as 0.01 or maybe even same as 0.1, code is not very good for my program....can someone help me pause for very very short time

Thank You

czimmerman
September 28th, 1999, 10:24 PM
Try using Sleep API function. This is supposed to take milliseconds as a parameter. I don't know how well it works at this level, but it is supposed to theoretically.

See http://www.freevbcode.com/ShowCode.Asp?ID=74 for example.

Arun Sahoo
September 29th, 1999, 12:05 AM
use this below option explicit
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

where u want to pause execution use

sleep(no of milliseconds)
e.g. sleep(100)

It will pause for 100 millisecont

Please write me back about responce
Thanks
Arun(arun@esspl.com)