From 9084ce803bf19e5f5cf5691a390a5b968a7790cf Mon Sep 17 00:00:00 2001 From: Alexander Bushnev Date: Wed, 24 Jan 2024 23:28:39 +0100 Subject: [PATCH] Added the possibility of a small error --- zenoh/tests/interceptors.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zenoh/tests/interceptors.rs b/zenoh/tests/interceptors.rs index 3a9c1a1afc..9ab78747ed 100644 --- a/zenoh/tests/interceptors.rs +++ b/zenoh/tests/interceptors.rs @@ -42,13 +42,13 @@ fn downsampling() { let curr_time = std::time::Instant::now(); if sample.key_expr.as_str() == "test/downsamples/r100" { let mut last_time = last_time_r100.lock().unwrap(); - let interval = (curr_time - *last_time).as_millis(); + let interval = (curr_time - *last_time).as_millis() + 1; *last_time = curr_time; println!("interval 100: {}", interval); assert!(interval >= 100); } else if sample.key_expr.as_str() == "test/downsamples/r50" { let mut last_time = last_time_r50.lock().unwrap(); - let interval = (curr_time - *last_time).as_millis(); + let interval = (curr_time - *last_time).as_millis() + 1; *last_time = curr_time; println!("interval 50: {}", interval); assert!(interval >= 50);