Skip to content
UPEEC

time

Timestamps, sleeping and high-resolution timers.

Beginner
Comments 0
import time
time.time()            # seconds since 1970
time.sleep(0.5)
t0 = time.perf_counter(); work(); print(time.perf_counter() - t0)
time.monotonic()       # for measuring intervals

Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.

Discussion (0)

Sign in or join free to ask questions and discuss this topic.