Results 1 to 2 of 2

Thread: Need help on a count/timer/wait fuction

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2001
    Location
    www.alexdata.com
    Posts
    484

    Lightbulb Need help on a count/timer/wait fuction

    I have this function that waits for 1sec.. and it works good!! But..
    I would like a function that counted MS (not microsoft,hehe)
    MicroSeconds.. So that i could wait for 200ms instead of a1 Sec...

    My function that waits for 1 sec uses date to count a second, is there another function out there which i can use to count from 1 -1000mS ?? I really need it as "DoEvents" doesnt fit my needs !!

    Code i have is:
    VB Code:
    1. 'Count 1 second
    2. Function Count1()
    3. On Error Resume Next
    4. Dim EndTime1 As Date
    5. EndTime1 = DateAdd("s", 1, Now)
    6. Do Until Now > EndTime1
    7. DoEvents
    8. Loop
    9. End Function

    But please psot any small funtion that can wait/count X.. mS !!
    Thanks in advance !
    ***************
    Please use [highlight=vb] ..your code.. [/highlight] when posting code!

    When you have received the working answer to your question,
    please mark it as *SOLVED* + Your Questions Title ...using your Thread's Tool menu.


    Also try to point out what answer made it work for you, or edit your first post to contain a quote of the correct answer...

    Please Answer All Questions With Working Code Examples...


    My Unfinished Projects and My working Programs
    ***************

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    VB Code:
    1. Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

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