10 examples of 'python time sleep' in Python

Every line of 'python time sleep' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
108def sleep(sec):
109 """Sleep sec in commands"""
110 def sleeper():
111 import time
112 time.sleep(sec)
113 return sleeper
Important

Use secure code every time

Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code

34def sleep_actual(t):
35 original_sleep(t)
189def sleep(seconds):
190 """A reimplementation of the xbmc sleep() function"""
191 time.sleep(seconds)
27def sleep(*args):
28 """ Args for backwards compatibility
29 """
30 if skip_sleep:
31 return
32 time.sleep(1)
35def sleep(n):
36 time.sleep(n)
21def sleep(t, safe=True):
22 """
23 pause operations
24
25 Unlike standard time.sleep(...), breaks pause when controller shutdown
26 event is received.
27
28 Args:
29 t: number of seconds to sleep
30
31 Optional:
32 safe: break on shutdown event (default is True)
33
34 Returns:
35 True if sleep is finished, False if shutdown event is received
36 """
37 if safe:
38 time_start = time()
39 time_end = time_start + t
40 while time() < time_end:
41 if is_shutdown():
42 return False
43 _sleep(_polldelay)
44 return True
45 else:
46 _sleep(t)
47 return True
58def sleep_until(target_time):
59 """If the given time (in secs) hasn't passed, sleep until it arrives."""
60 now = time()
61 if now < target_time:
62 sleep(target_time - now)
70@overload
71def sleep(secs: float) -> None: pass
29def sleep_for(secs):
30 time.sleep(secs)
166def __sleep(self):
167 if self.rateSleep > 0:
168 seconds = self.rateSleep
169 self.rateSleep = 0
170 else:
171 roundSecs = _now() - self.roundStart
172 seconds = self.sleep - min(self.sleep, roundSecs)
173
174 for i in range(int(seconds)):
175 if self.killed:
176 return
177 time.sleep(1)

Related snippets