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

Unlock This Lesson

This lesson is for members only. Join us and get access to thousands 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 your subtitle preferences 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 refer to our video player troubleshooting guide for assistance.

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!

myca on Aug. 7, 2021

Very impressed with the quality of the videos!

Become a Member to join the conversation.