def rush(enable=True, realtime=False):
 if importWindllFailed:
  return False
 pr_rights = (PROCESS_QUERY_INFORMATION | PROCESS_SET_INFORMATION)
 pr = windll.OpenProcess(pr_rights, FALSE, os.getpid())
 thr = windll.GetCurrentThread()
 if (enable is True):
  if (realtime is False):
   windll.SetPriorityClass(pr, HIGH_PRIORITY_CLASS)
   windll.SetThreadPriority(thr, THREAD_PRIORITY_HIGHEST)
  else:
   windll.SetPriorityClass(pr, REALTIME_PRIORITY_CLASS)
   windll.SetThreadPriority(thr, THREAD_PRIORITY_TIME_CRITICAL)
 else:
  windll.SetPriorityClass(pr, NORMAL_PRIORITY_CLASS)
  windll.SetThreadPriority(thr, THREAD_PRIORITY_NORMAL)
 return True

def rush ( enable = True , realtime = False ) : if importWindllFailed : return False pr_rights = ( PROCESS_QUERY_INFORMATION | PROCESS_SET_INFORMATION ) pr = windll . OpenProcess ( pr_rights , FALSE , os . getpid ( ) ) thr = windll . GetCurrentThread ( ) if ( enable is True ) : if ( realtime is False ) : windll . SetPriorityClass ( pr , HIGH_PRIORITY_CLASS ) windll . SetThreadPriority ( thr , THREAD_PRIORITY_HIGHEST ) else : windll . SetPriorityClass ( pr , REALTIME_PRIORITY_CLASS ) windll . SetThreadPriority ( thr , THREAD_PRIORITY_TIME_CRITICAL ) else : windll . SetPriorityClass ( pr , NORMAL_PRIORITY_CLASS ) windll . SetThreadPriority ( thr , THREAD_PRIORITY_NORMAL ) return True
raise the priority of the current thread/process .