Sleep in simulated time.
760966
def sleep(self, seconds):
        
        start = self.time()
        while (self.time() - start < seconds and
               not self.need_to_stop.is_set()):
            self.need_to_stop.wait(self.sim_time)
151884
def _adapt_sleep_interval(self, sent, received, queue, now):
        
        Global.LOGGER.debug("adjusting sleep interval")

        dispatched_since_last_check = sent - self.last_queue_check_count
        seconds_since_last_check = (
            now - self.last_queue_check_date).total_seconds()

        Global.LOGGER.debug(
            str(dispatched_since_last_check) + " dispatched in the last " + str(seconds_since_last_check))
        sleep_time = (seconds_since_last_check /
                      (dispatched_since_last_check + queue + 1)) * 0.75

        if sleep_time > 0.5:
            sleep_time = 0.5

        if sleep_time < 0.0001:
            sleep_time = 0.0001

        self.last_queue_check_date = now
        self.last_queue_check_count = sent

        Global.CONFIG_MANAGER.message_fetcher_sleep_interval = sleep_time

        sleep_interval_log_string = f"new sleep_interval = {sleep_time}"
        Global.LOGGER.debug(sleep_interval_log_string)

        if Global.CONFIG_MANAGER.show_stats:
            Global.LOGGER.info(sleep_interval_log_string)
979101
protected void sleep() {
    try {
      Thread.sleep(sleepIntervalInMillis);
    } catch (InterruptedException exception) {
      Thread.currentThread().interrupt();
      throw new SelendroidException(exception);
    }
  }
959247
public function onSleep()
    {
        Daemon::$req = null;
        Daemon::$context = null;
        $this->running = false;
        Daemon::$process->setState(Daemon::WSTATE_IDLE);
    }
1040104
private static void sleepFor(int time, TimeUnit units) {
        try {
            LOG.trace("Sleeping for {} {}", time, units.toString());
            Thread.sleep(units.toMillis(time));
        } catch (InterruptedException e) {
            // no-op
        }
    }
712879
public static void sleep(long length, TimeUnit unit) {
		try {
			unit.sleep(length);
		} catch (InterruptedException e) {
			Thread.currentThread().interrupt();
		}
	}
1244084
@Nonnull
  public static ESuccess sleepSeconds (@Nonnegative final long nSeconds)
  {
    ValueEnforcer.isGE0 (nSeconds, "Seconds");
    return sleep (nSeconds * CGlobal.MILLISECONDS_PER_SECOND);
  }
1159295
public static boolean sleep(Number millis) {
		if (millis == null) {
			return true;
		}

		try {
			Thread.sleep(millis.longValue());
		} catch (InterruptedException e) {
			return false;
		}
		return true;
	}
801476
def sleep(seconds=0):
    
    loop = evergreen.current.loop
    current = Fiber.current()
    assert loop.task is not current
    timer = loop.call_later(seconds, current.switch)
    try:
        loop.switch()
    finally:
        timer.cancel()
1368709
public static void sleepQuietly(final long sleepFor, final TimeUnit unit) {
		try {
			Thread.sleep(unit.toMillis(sleepFor));
		} catch (Throwable t) {
			// do nothing
		}
	}
1009024
def main(idle):
    """"""
    while True:

        LOG.debug("Sleeping for {0} seconds.".format(idle))
        time.sleep(idle)
382126
def every(secs):
    '''
    
    '''
    time_stated = time.monotonic()
    while True:
        time_yielded = time.monotonic()
        yield time_yielded - time_stated
        time.sleep(max(0, secs + time_yielded - time.monotonic()))
80751
def sleep(self, seconds):
        
        try:
            self.lock()
            time.sleep(seconds)
        except compat.TimeoutException:
            _logger.debug("Connection %r timed out while waiting for lock acquisition.", self.container_id)
        finally:
            self.release()
366019
def sleep(self, unique_id, delay, configs=None):
    
    self.pause(unique_id, configs)
    time.sleep(delay)
    self.resume(unique_id, configs)
275511
async def _continueAfterSleep(self, seconds):
        
        assert self._sleeping is None
        self._sleeping = InterruptibleSleep(seconds)
        try:
            await self._sleeping.wait()
            return True
        except asyncio.CancelledError:
            return not self._is_stopping
        finally:
            self._sleeping = None
841893
public SleepBuilder<T> withInterval(long interval, TimeUnit timeUnit) {
        this.interval = timeUnit.toMillis(interval);
        return this;
    }
1094983
def _get_sleep_interval(self, start_time):
        """"""
        elapsed = time.time() - start_time
        if elapsed < 0.05:
            return 0.01
        elif elapsed < 1.0:
            return 0.05
        elif elapsed < 10.0:
            return 0.1
        elif elapsed < 60.0:
            return 0.5
        return 1.0