Skip to content

std::time vs tokio::time #4633

Answered by Darksonn
Banyc asked this question in Q&A
Apr 22, 2022 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

The sleeping functions in the standard library are blocking, so they can't be used in async code. The ones in tokio::time are the alternatives. You can read more about the difference between blocking and async functions here.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by hawkw
Comment options

You must be logged in to vote
1 reply
@Darksonn
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants