Function mioco::sleep [] [src]

pub fn sleep(duration: Duration)

Block execution for a given time.

Inside mioco coroutine, this will yield execution and block coroutine for a given period of time.

Out of mioco instance, this will act just like std::thread::sleep.

Warning: When issued inside of mioco, the precision of this call (and other time based functionality) is limited by mio event loop settings. Any small value of time_ms will effectively be rounded up to mio::EventLoop::timer_tick_ms(). This can be configured with custom mioco::Config argument passed to mioco::new_configured()