Short pause

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?Qm9iQWNoZ2lsbA==?=

    #1

    Short pause

    I need to pause the action of my code for a quarter second or so. What can
    I use to do this?

    Thanks!

    Bob
  • Armin Zingler

    #2
    Re: Short pause

    "BobAchgill " <BobAchgill@dis cussions.micros oft.comschrieb
    I need to pause the action of my code for a quarter second or so.
    What can I use to do this?
    System.Threadin g.Thread.Sleep( 250)

    But why?


    Armin

    Comment

    • =?Utf-8?B?Qm9iQWNoZ2lsbA==?=

      #3
      Re: Short pause

      I am "Hooking the keyboard" and it seems that I need to give the hooking
      process some slack time so my code does not get ahead of the hooking process.
      At least the pause is helping. Thanks!

      Bob

      "Armin Zingler" wrote:
      "BobAchgill " <BobAchgill@dis cussions.micros oft.comschrieb
      I need to pause the action of my code for a quarter second or so.
      What can I use to do this?
      >
      System.Threadin g.Thread.Sleep( 250)
      >
      But why?
      >
      >
      Armin
      >

      Comment

      • Miro

        #4
        Re: Short pause

        Maybe you can create a class with a property you can set.
        Make a boolean property, set it to false in the begining, and dont start
        accepting any info from the keyboard until the paramter is set to true -
        once you can confirm the hook is complete?

        Just a thought.

        Miro

        "BobAchgill " <BobAchgill@dis cussions.micros oft.comwrote in message
        news:0C841E53-1575-4673-9F01-ADB828922DA4@mi crosoft.com...
        >I am "Hooking the keyboard" and it seems that I need to give the hooking
        process some slack time so my code does not get ahead of the hooking
        process.
        At least the pause is helping. Thanks!
        >
        Bob
        >
        "Armin Zingler" wrote:
        >
        >"BobAchgill " <BobAchgill@dis cussions.micros oft.comschrieb
        I need to pause the action of my code for a quarter second or so.
        What can I use to do this?
        >>
        >System.Threadi ng.Thread.Sleep (250)
        >>
        >But why?
        >>
        >>
        >Armin
        >>

        Comment

        • =?UTF-8?B?R8O2cmFuIEFuZGVyc3Nvbg==?=

          #5
          Re: Short pause

          BobAchgill wrote:
          I am "Hooking the keyboard" and it seems that I need to give the hooking
          process some slack time so my code does not get ahead of the hooking process.
          At least the pause is helping. Thanks!
          It's helping, but it's not guaranteed to work. Just because you are
          pausing your thread for a while, doesn't mean that the thread that is
          doing the hooking is guaranteed to run during that time. If the computer
          is busy doing something else, the hooking process might need more time
          to complete.

          I agree with Miro that you should try to determine when the process
          actually is complete, instead of just waiting for a while and hoping
          that it is enough.

          --
          Göran Andersson
          _____
          Göran Anderssons privata hemsida.

          Comment

          Working...