Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

This lesson is for members only. Join us and get access to hundreds of tutorials and a community of expert Pythonistas.

Unlock This Lesson

Hint: You can adjust the default video playback speed in your account settings.
Hint: You can set the default subtitles language in your account settings.
Sorry! Looks like there’s an issue with video playback 🙁 This might be due to a temporary outage or because of a configuration issue with your browser. Please see our video player troubleshooting guide to resolve the issue.

Using sleep() to Code an Uptime Bot (Summary)

Now that you’ve seen how to use time.sleep(), you should think of it whenever you need to make a delay or pause in your code’s execution.

In this course, you learned:

  • The basics of time.sleep()
  • How you can use timeit to measure your code’s execution time
  • How to use time.sleep() to build an uptime bot

For some next steps for your newly-built uptime bot, check out these other Real Python resources:

Download

Sample Code (.zip)

1.5 KB

Download

Course Slides (.pdf)

3.4 MB

Daniel Galvan on Aug. 4, 2021

Great job Martin!

mijoclfu on Aug. 7, 2021

very impressed with the quality of videos!

Become a Member to join the conversation.