Closed khvzak closed 6 months ago
An example:
#[ntex::main] async fn main() -> Result<(), ()> { let fut = async { ntex::time::sleep(ntex::time::Millis(15)).await; 1 }; let res = ntex::time::timeout(ntex::time::Millis(10), fut).await; println!("{res:?}"); Ok(()) }
prints Ok(1) but should print Err(()). ntex latest v1.1.2, macOS x86_64 14.3, tokio.
Ok(1)
Err(())
tokio
Same example using tokio::time works fine.
tokio::time
it is not precise and it is explicit decision. resolution is 16 millis.
main purpose of the ntex timer is network timeouts and those usually within seconds
Thanks for confirming!
An example:
prints
Ok(1)
but should printErr(())
. ntex latest v1.1.2, macOS x86_64 14.3,tokio
.Same example using
tokio::time
works fine.