Last active
September 18, 2018 18:05
-
-
Save Archina/6e6d98f6972eca50eca4dcd064c0f016 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate futures; | |
extern crate tokio; | |
use futures::{Future, Stream}; | |
use tokio::timer::*; | |
use std::time::{Duration, Instant}; | |
fn main() { | |
let ten_millis = Duration::from_millis(150); | |
let interval_a = Interval::new(Instant::now(), ten_millis); | |
let interval_b = Interval::new(Instant::now(), ten_millis); | |
let task = interval_a | |
.for_each(|_x| { | |
println!(""); | |
println!("TestString"); | |
Ok(()) | |
}) | |
.map_err(|_| (()) ); | |
tokio::run(task); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment