Non-polling/Non-blocking Timer?

There’s a built-in simple solution, using the threading module:

import threading

timer = threading.Timer(60.0, callback)
timer.start()  # after 60 seconds, 'callback' will be called

## (in the meanwhile you can do other stuff...)

You can also pass args and kwargs to your callback. See here.

Leave a Comment