#[cfg(all(feature = "tokio_runtime", not(feature = "async_runtime")))]
pub fn block_on<F, M>(future: F) -> M
where
F: Future<Output = M>,
{
#[allow(clippy::unwrap_used)]
let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(future)
}
#[cfg(feature = "tokio_runtime")]
pub use tokio::time::sleep;
#[cfg(all(not(feature = "tokio_runtime"), feature = "async_runtime"))]
pub use async_global_executor::block_on;
#[cfg(all(not(feature = "tokio_runtime"), feature = "async_runtime"))]
pub async fn sleep(duration: std::time::Duration) {
async_io::Timer::after(duration).await;
}