pub fn new(dur: Duration) -> Timer {
        let reactor = crate::executor().reactor();
        Timer {
            inner: Rc::new(RefCell::new(Inner {
                id: reactor.register_timer(),
                is_charged: false,
                when: Instant::now() + dur,
                reactor: Rc::downgrade(&reactor),
            })),
        }
    }
/// Creates a timer that expires after the given duration of time.
///
/// # Examples
///
/// ```
/// use glommio::{timer::Timer, LocalExecutor};
/// use std::time::Duration;
///
/// let ex = LocalExecutor::default();
/// ex.run(async move {
///     Timer::new(Duration::from_millis(100)).await;
/// });
/// ```
Creates a timer that expires after the given duration of time.
Creates a timer that expires after the given duration of time .
pub fn new(dur: Duration) -> Timer {
        let reactor = crate::executor().reactor();
        Timer {
            inner: Rc::new(RefCell::new(Inner {
                id: reactor.register_timer(),
                is_charged: false,
                when: Instant::now() + dur,
                reactor: Rc::downgrade(&reactor),
            })),
        }
    }
pub fn new ( dur : Duration ) -> Timer { let reactor = crate :: executor ( ) . reactor ( ) ; Timer { inner : Rc :: new ( RefCell :: new ( Inner { id : reactor . register_timer ( ) , is_charged : false , when : Instant :: now ( ) + dur , reactor : Rc :: downgrade ( & reactor ) , } ) ) , } }
Creates a timer that expires after the given duration of time.
Creates a timer that expires after the given duration of time .
dur
Duration
dur
Duration
examples
```
use glommio::{timer::Timer, LocalExecutor};
use std::time::Duration.

let ex = LocalExecutor::default();
ex.run(async move {
Timer::new(Duration::from_millis(100)).await;
});
```
` ` ` use glommio :: { timer :: Timer LocalExecutor } ; use std :: time :: Duration . let ex = LocalExecutor :: default () ; ex . run ( async move { Timer :: new ( Duration :: from_millis ( 100 )) . await ; } ) ; ` ` `