A
A
Alice Cherry2019-07-15 17:35:03
Python
Alice Cherry, 2019-07-15 17:35:03

How to make a second timer?

I'm making my Discord bot and there's a countdown (20 seconds). I call the asyncio.sleep(1) function and change the value. A simple print() prints like this (at the end of the program runtime):
unknown.png
I have no idea what will happen if you send the results to the Internet. Making the delay less is not an option, because the result is either 20.8, or 20.4, and the like. How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2019-07-15
@dimonchik2013

round
as long as OS is not a real-time system, you should always round

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question