// This software is available under the Apache-2.0 license.
//
// See https://www.apache.org/licenses/LICENSE-2.0.txt for full text.
//
// Copyright (c) 2024, Gluu, Inc.
//! Cross-platform async sleep for background tasks.
//!
//! Tokio timers require a Tokio runtime; browser WASM builds use [`gloo_timers`] instead.
use Duration;
/// Yields asynchronously for approximately `duration`.
///
/// On native targets this uses [`tokio::time::sleep`]. On WebAssembly it uses a browser
/// timer so background work (for example status list refresh) does not require a Tokio
/// reactor.
pub async