diff --git a/src/xtimer.rs b/src/xtimer.rs index 5326ad7..c96c0a3 100644 --- a/src/xtimer.rs +++ b/src/xtimer.rs @@ -2,6 +2,8 @@ use std::rc::{Rc, Weak}; use std::cell::RefCell; use std::any::Any; use std::cmp; +use std::time::{Duration, Instant}; + use r9_macro::SharedFromSelf; use r9_macro_derive::SharedFromSelf; @@ -307,9 +309,7 @@ impl XTimer { expire_time: i32, cb: TimerCb, attacher: Option) -> XTimerWp { - println!("2222"); let t = self.new_timer_list(); - println!("111111"); t.borrow_mut().cb = Some(cb); t.borrow_mut().timer_type = timer_type; t.borrow_mut().expire_time = expire_time; @@ -358,7 +358,6 @@ impl XTimer { index = (t.borrow().expires >> (TVR_BITS + 3 * TVN_BITS)) & (TVN_MASK as i64); vec = &self.tv5[index as usize]; } - println!("add2 idx:{} index:{}", idx, index); crate::ListHead::::add_tail(&vec, &t.borrow_mut().timer_entry); } @@ -514,7 +513,8 @@ impl XTimer { } fn gc_timer(&mut self, e: TimerEvent, _args: Option>>) { - println!("aaaaa"); + let now = Instant::now(); + println!("now: {:?}", now); match e { TimerEvent::Exec => { while self.free_timer_num > self.cache_timer_num &&