You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 2, 2018. It is now read-only.
This seems to be a dumb question, but how can we stop a timer, there's no such "reset()" or "stop" interface.
My code basically looks like this:
let mut core = ::tokio_core::reactor::Core::new().unwrap();
let timer = Timer::default();
let my_timer = timer.interval(std::time::Duration::from_millis(1_000))
.for_each(|_| {
println!("timer triggered");
// how can I e.g. remove this my_timer after three triggers?
Ok(())
});
core.run(my_timer).unwarp();
The text was updated successfully, but these errors were encountered:
This seems to be a dumb question, but how can we stop a timer, there's no such "reset()" or "stop" interface.
My code basically looks like this:
The text was updated successfully, but these errors were encountered: