[lang-ref] ( sleep ) ( python )
def test_sleep():
# time.sleep(s)
import time
t0 = time.perf_counter()
time.sleep(0.01) # seconds
t1 = time.perf_counter()
elapsed_seconds = t1 - t0
assert elapsed_seconds >= 0.01
def test_sleep():
# time.sleep(s)
import time
t0 = time.perf_counter()
time.sleep(0.01) # seconds
t1 = time.perf_counter()
elapsed_seconds = t1 - t0
assert elapsed_seconds >= 0.01