10 examples of 'python os sleep' in Python

Every line of 'python os 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
35def sleep(n):
36 time.sleep(n)
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

27def sleep(*args):
28 """ Args for backwards compatibility
29 """
30 if skip_sleep:
31 return
32 time.sleep(1)
189def sleep(seconds):
190 """A reimplementation of the xbmc sleep() function"""
191 time.sleep(seconds)
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
108def sleep(sec):
109 """Sleep sec in commands"""
110 def sleeper():
111 import time
112 time.sleep(sec)
113 return sleeper
34def sleep_actual(t):
35 original_sleep(t)
29def sleep_for(secs):
30 time.sleep(secs)
10def sleep():
11 for _ in range(3):
12 time.sleep(0.1)
13 gc.collect()
14 for _ in range(3):
15 time.sleep(0.1)
124def sleep(sleep, quiet=False):
125 if sleep >= 1:
126 sleep_widget = [
127 progressbar.Bar('>'), ' ', progressbar.ETA(), ' ', progressbar.ReverseBar('<')
128 ]
129 print("Now spleeping until the next loop")
130 if quiet is False:
131 pbar = progressbar.ProgressBar(widgets=sleep_widget, maxval=int(sleep)).start()
132 for i in xrange(int(sleep)):
133 time.sleep(1)
134 pbar.update(i+1)
135 time.sleep(sleep - int(sleep))
136 pbar.finish()
137 else:
138 time.sleep(sleep)
70@overload
71def sleep(secs: float) -> None: pass

Related snippets