An asynchronous implementation of background timers in Python3. Requires Python 3.5+
Install this package using pip
.
$ pip install git+https://github.com/extr3mis/aiotimers.git
Import the package using the given import statement.
>>> from aiotimers import Timer
Now you can simply make a Timer
object and initialize it with the time (in seconds) you want to wait until, and the callback function/coroutine that you want to be called once the timer is complete. Optionally, you can also pass args and kwargs as a tuple
and a dict
respectively.
>>> timer = Timer(30.00, mycallback)