Batched timeout doc (#2716)

* timeout doc

* clp

* FMT
This commit is contained in:
Dongjia "toka" Zhang 2024-11-21 15:52:12 +01:00 committed by GitHub
parent f3ab3c744e
commit 391147c950
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -242,6 +242,11 @@ impl TimerStruct {
#[cfg(target_os = "linux")]
#[must_use]
/// Constructor but use batch mode
/// Timeout mechanism with imprecise timing.
///
/// The timeout will trigger after t seconds and at most within 2*t seconds.
/// This means the actual timeout may occur anywhere in the range [t, 2*t],
/// providing a flexible but bounded execution time limit.
pub fn batch_mode(exec_tmout: Duration) -> Self {
let mut me = Self::new(exec_tmout);
me.batch_mode = true;