V
V
VladosYT2022-01-15 15:34:50
Python
VladosYT, 2022-01-15 15:34:50

How can I make a certain command run separately from all commands and not slow down the program with the time.sleep() line?

I need to make the command run every 20 minutes, but still make the rest of the code work. The problem is that I'm using time.sleep() which stops the whole program for a certain amount of time, and I only need to stop a specific function. Tried to do with threads but nothing worked because I'm using functions like async/await.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2022-01-15
@VladosYT

Yes, as you are tired of time.sleep for async, a simple google will immediately show asyncio.sleep. Better yet, learn the basics of working with async
PS still tired of the fact that all "bot writers" cannot do elementary things, read https://docs.python.org/3/library/asyncio.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question