Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1299
  • Last Modified:

Sleep the Process

How can i stop the process for some seconds in  VB6.0 ?  
0
vinaikk
Asked:
vinaikk
  • 3
  • 3
  • 2
  • +1
1 Solution
 
joachimcCommented:
Sleep(5000)

to sleep in 5 secs..

/Joachim
0
 
BrianGEFF719Commented:
use the sleep api, call it like this...

call sleep(5000) '1000 = 1 second
0
 
Ryan ChongCommented:
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
BrianGEFF719Commented:
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
 
Ryan ChongCommented:
Correct my codes:

dim n as long

n = 30000

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


0
 
vinaikkAuthor Commented:
This is too good thanks a ton !!!
0
 
joachimcCommented:
Get out of here. Give the points to the right answer.
0
 
BrianGEFF719Commented:
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
 
joachimcCommented:
Not your fault he should know who to choose by himself shouldn't he :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now