Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extern crate futures; // 0.1.28
- extern crate tokio; // 0.1.22
- use std::time::Duration;
- use futures::Stream;
- use tokio::timer::DelayQueue;
- fn main() {
- let mut times1 = DelayQueue::new();
- times1.insert(1, Duration::new(3, 0));
- times1.insert(2, Duration::new(3, 0));
- for time in times1.wait() {
- dbg!(time);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement