Closed ImNimboss closed 3 years ago
Couldn’t you use time.perf_counter
?
Logic for this would just be
first = await send("start")
last = await wait_for(...)
taken = last.created_at - first.created_at
This feels like a pretty niche request anyway.
Couldn’t you use
time.perf_counter
?
Time is blocking tho
Logic for this would just be
first = await send("start") last = await wait_for(...) taken = last.created_at - first.created_at
This feels like a pretty niche request anyway.
Thanks, was looking for something like this :)
Couldn’t you use
time.perf_counter
?Time is blocking tho
I mean time.perf_counter
isn't blocking.
Summary
The ability to see how long the user took to do
x
action inclient.wait_for()
What is the feature request for?
The core library
The Problem
Example - I'm trying to make a typeracer command and would like to see how long the user took to answer, and I'm using wait_for() to detect the message. I can't find a good and asynchronous way to do that.
The Ideal Solution
Maybe wait_for() can return the message AND the time it took for the user to enter the message in a tuple/list if specified in function parameters?
The Current Solution
No good solutions, not that I'm aware of
Additional Context
No response