Skip to content

Commit 9563307

Browse files
authored
Update timer_loop.rs
Moving time probe outside of loop
1 parent b4290c2 commit 9563307

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/timer_loop.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ impl<K: SandClockInsertion + Debug> TimerLoop<K> {
5656

5757
std::thread::spawn(move || {
5858
let mut expired_queue: Vec<InsertSync<K>> = vec![];
59-
loop {
59+
60+
let now = Instant::now();
61+
loop {
6062
let mut conn_it = map.iter_mut();
6163
'inner_it: loop {
6264
if let Some(mut connection_status_ref) = conn_it.next() {
@@ -68,7 +70,7 @@ impl<K: SandClockInsertion + Debug> TimerLoop<K> {
6870
let last_updated_instant =
6971
connection_status.time_out_info().get_last_instant_update();
7072

71-
let now = Instant::now();
73+
7274

7375
if now.duration_since(last_updated_instant) >= time_out {
7476
let key = connection_status_ref.key().clone();

0 commit comments

Comments
 (0)