On this page
  1. time.sleep
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

time.sleep

Prev: time.process_time_ns | Up: time | Next: time.strftime
Rel: time.asctime, time.clock_getres, time.clock_gettime, time.clock_gettime_ns
Ref: docs.python.org — time.sleep
Tags: #public #python3 #stdlib #time


Import

import time
from time import sleep

Signature & Overview

time.sleep(object, /)

Delay execution for a given number of seconds. The argument may be a floating-point number for subsecond precision.

Usage

import time

t0 = time.monotonic()
time.sleep(0.01)
assert time.monotonic() - t0 >= 0.005

Gotchas

REPL Inspect

from time import sleep
help(sleep)

Linked from

Related notes