mt.time

Additional utitlities dealing with time.

Instead of:

import time

You do:

from mt import time

It will import the time package plus the additional stuff implemented here.

Please see Python package time for more details.

Functions

mt.time.sleep_until(func, check_interval=1, timeout=86400, logger=None)

Sleeps until function evaluates to true.

Parameters:
  • check_interval (float) – number of seconds between two checks, in seconds

  • timeout (float) – number of seconds before timeout, in which case a TimeoutError is raised

  • logger (logging.Logger or equivalent) – logging for debugging purposes