add a settings for the search cutoff

This commit is contained in:
Tamo 2024-03-11 18:24:21 +01:00
parent 4a467739cd
commit d1db495119
11 changed files with 169 additions and 35 deletions

View file

@ -121,6 +121,12 @@ impl fmt::Debug for TimeBudget {
}
}
impl Default for TimeBudget {
fn default() -> Self {
Self::new(std::time::Duration::from_millis(150))
}
}
impl TimeBudget {
pub fn new(budget: std::time::Duration) -> Self {
Self { started_at: std::time::Instant::now(), budget }