title: Python stops registering mouse inputs?
body: <p>I have this code here. I coded this "bot" in order to increase mouse clicks. I've only one issue, python stops registering mouse inputs during that time.sleep (marked with #issue). When I set it to 20/30 ms I can barely notice it, but whenver I try to increase it, it gets more noticeable and annoying, since my cursor completely stops moving. I really don't know where the problem is. Thank you all in advance. </p>
  
  <pre><code>import win32api
  import win32con
  import time
  from random import randint
  import pythoncom, pyHook
  import sys
  
  semaphore = False 
  
  def OnMouseLeftUp(event): 
      global semaphore
      if semaphore:
          return True
      semaphore = True
  
      if randint(0, 24) &lt; 7 :
          time.sleep(float(randint(6,11))/1000)  #issue  
          win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
  
  
      semaphore = False
      return True
  
  
  
  # create a hook manager
  hm = pyHook.HookManager()
  # set the hook
  hm.HookMouse()
  # waits for MouseLeftUp event
  hm.MouseLeftUp = OnMouseLeftUp # Triggers OnMouseLeftUp function
  
  # wait forever
  pythoncom.PumpMessages()
  </code></pre>