'Sleeps until the requested time.'

def sleep_until(self, wake_time):

    delta = (wake_time - time.time())
    if (delta <= 0):
        return
    offset_ = self.offset
    if (delta > offset_):
        time.sleep((delta - offset_))
    remaining_time = (time.time() - wake_time)
    with self._lock:
        if (self.offset == offset_):
            offset_delta = ((offset_ - Sleeper._MIN_OFFSET) / 2)
            if (remaining_time > 0):
                self.offset -= offset_delta
            elif (remaining_time < (- Sleeper._MIN_OFFSET)):
                self.offset += offset_delta
    while (time.time() < wake_time):
        pass
