-
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.
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.
-
Came here to find out why |
Beta Was this translation helpful? Give feedback.
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.