diff --git a/examples/napi/src/threadsafe_function.rs b/examples/napi/src/threadsafe_function.rs index 41a692b7..f4adcf50 100644 --- a/examples/napi/src/threadsafe_function.rs +++ b/examples/napi/src/threadsafe_function.rs @@ -138,6 +138,7 @@ pub async fn tsfn_return_promise_timeout(func: ThreadsafeFunction) -> Resul use tokio::time::{self, Duration}; let promise = func.call_async::>(Ok(1)).await?; let sleep = time::sleep(Duration::from_millis(100)); + let sleep = time::sleep(Duration::from_nanos(1)); tokio::select! { _ = sleep => { return Err(Error::new(Status::GenericFailure, "Timeout".to_owned()));