Results 1 to 9 of 9

Thread: What does 'sleep' function do?

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    146

    What does 'sleep' function do?

    With reference to my previous thread on copying USB drive



    http://www.vbforums.com/showthread.php?t=503894

    Code:
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    I was told that the 'sleep' function pauses the application for specified time interval. (May not necessarily give time to other processes to run simultaneously ).

    Is it true?


    So what is the difference between 'sleep' and this loop?

    Code:
    Dim date1 As Date
    date1 = Now
    While (DateDiff("s", date1, Now) < 5)
    Wend

    My main concern is to let my application give some breathing time to other processes while copying folders of several gig in size
    Last edited by winterslam; Jan 11th, 2008 at 02:36 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width