Time delay in Python

David Y.

The Problem

How do I make a time delay in Python?

The Solution

We can do this using the sleep() function in Python’s built-in time module. This function will pause execution by a provided number of seconds. For example:

from time import sleep print("Waiting 1 minute...") sleep(60) print("1 minute has passed.")
Join the discussionCome work with us
Share on Twitter
Bookmark this page
Ask a questionImprove this Answer

Related Answers

A better experience for your users. An easier life for your developers.

    TwitterGitHubDribbbleLinkedin
© 2023 • Sentry is a registered Trademark
of Functional Software, Inc.