Solved

Sleep the Process

Posted on 2001-06-07
9
1,262 Views
Last Modified: 2007-11-27
How can i stop the process for some seconds in  VB6.0 ?  
0
Comment
Question by:vinaikk
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 4

Expert Comment

by:joachimc
ID: 6162920
Sleep(5000)

to sleep in 5 secs..

/Joachim
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 6162937
use the sleep api, call it like this...

call sleep(5000) '1000 = 1 second
0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 6162941
Hi, to use Sleep(n) , n = miliseconds. You need to add this API first:

Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)

Sleep 3000 ' = 3 seconds

OR

You can create a For Loop like this:

dim n as long
For i = 1 to n
     Doevents 'Let Windows handles other processes.
Next i


'Hope will help.
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 19

Accepted Solution

by:
BrianGEFF719 earned 5 total points
ID: 6162943
LOL, when i read the question there was no comments, i went to the bathroom came back and commented and your comment was there...


0
 
LVL 50

Expert Comment

by:Ryan Chong
ID: 6162947
Correct my codes:

dim n as long

n = 30000

For i = 1 to n
    Doevents 'Let Windows handles other processes.
Next i


0
 

Author Comment

by:vinaikk
ID: 6163238
This is too good thanks a ton !!!
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6163381
Get out of here. Give the points to the right answer.
0
 
LVL 19

Expert Comment

by:BrianGEFF719
ID: 6163865
joahimc, I did not ask for the points...sorry about that...the reason i left that comment saying that i dident know your post was there i when i posted is because i loaded it and then when to the bathroom came back and posted as you can see my post is 2 min after yours...I dont want the points for it but i dont think there is anyway he can take them back and give them to you...but i do agree you deserve them...

Brian
0
 
LVL 4

Expert Comment

by:joachimc
ID: 6163877
Not your fault he should know who to choose by himself shouldn't he :)
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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