-
What is the difference between them and which one should I use? I cannot find answer elsewhere. Can we reduce duplicates? |
Beta Was this translation helpful? Give feedback.
Answered by
Darksonn
Apr 22, 2022
Replies: 2 comments 1 reply
-
The sleeping functions in the standard library are blocking, so they can't be used in async code. The ones in |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hawkw
-
Came here to find out why |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.