Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Eng-Tips
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Donate Today!

Do you enjoy these
technical forums?
Donate Today! Click Here

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

efighettib (Structural)
22 Jan 04 11:58
Hello

Someone knows any command that keep the program waiting for a few miliseconds, without using the timer control?

I need this to put between two calls

Call function1(a,b,c)
***** Here is the wait ****
Call function2(a,b,c)

Thanks a lot
Helpful Member!  efighettib (Structural)
23 Jan 04 9:37
After a long wait, I solved this problem on my own.

In a module, you have to declare

Public Declare Function GetTickCount Lib "kernel32" () As Long

Public Sub wait(ByVal dblMilliseconds As Double)
    Dim dblStart As Double
    Dim dblEnd As Double
    Dim dblTickCount As Double
    
    dblTickCount = GetTickCount()
    dblStart = GetTickCount()
    dblEnd = GetTickCount + dblMilliseconds
    
    Do
    DoEvents
    dblTickCount = GetTickCount()
    Loop Until dblTickCount > dblEnd Or dblTickCount < dblStart
       
    
End Sub



all what you kave to do now is to call wait(num), when num in the amount of miliseconds that the program waits to continue in the next line.

I hope this help to the rest of you.
meintsi (Mechanical)
23 Jan 04 16:57
This is easier:

Declare Sub Sleep Lib "kernel32" (ByVal milliseconds As Long)
' pause for 5 seconds
Sleep 5000



Remember...
       "If you don't use your head,
                       your going to have to use your feet."

CajunCenturion (Computer)
25 Jan 04 2:46
One thing to note about the Sleep command, is that it suspends all processing for that process while it's sleeping.

So if you want to wait for a few seconds, and not have the program do anything during that time, then Sleep is fine.

On the other hand, if your time delay is allow some other routine in your program sufficient time to complete its task, then Sleep will not work, because the other routine that you're waiting on, will also be sleeping.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close