Reputation: 201
I think std::thread::sleep(...) is not the right use case here.
std::thread::sleep(...)
Upvotes: 2
Views: 2231
Using the tokio crate, there exists this function
tokio::time::delay_for(tokio::time::Duration::from_millis(WAIT_TIME_INTERVAL_MS));
That actually waits for Duration with any execution.
Duration