Timers

Let’s understand the timer and how it represents certain tasks to run after specified time.

We'll cover the following

The threading module has a neat class called Timer that we can use to represent an action that should take place after a specified amount of time. They actually spin up their own custom thread and are started using the same start() method that a regular thread uses. We can also stop a timer using its cancel method. It should be noted that we can even cancel the timer before it’s even started.

Get hands-on with 1200+ tech skills courses.