psychos.core.wait#

psychos.core.wait(duration: float, sleep_interval: float = 0.8, hog_period: float = 0.02)[source]#

Wait for a specified duration while keeping the application responsive by processing events.

Parameters:
  • duration (float) – The total time to wait in seconds.

  • sleep_interval (float, default=0.8) – The time interval between event dispatching in seconds. This controls how often we dispatch events while waiting. Smaller values provide more responsiveness but increase CPU usage.

  • hog_period (float, default=0.02) – The duration at the end of the wait period during which the function continuously checks the time without sleeping to ensure accurate timing.