Advertisement
Guest User

Untitled

a guest
Aug 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. extern crate futures; // 0.1.28
  2. extern crate tokio; // 0.1.22
  3.  
  4. use std::time::Duration;
  5. use futures::Stream;
  6. use tokio::timer::DelayQueue;
  7.  
  8. fn main() {
  9. let mut times1 = DelayQueue::new();
  10. times1.insert(1, Duration::new(3, 0));
  11. times1.insert(2, Duration::new(3, 0));
  12.  
  13. for time in times1.wait() {
  14. dbg!(time);
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement