Creates new Interval
that yields with interval of period
. The first tick completes immediately.
An interval will tick indefinitely. At any time, the Interval
value can be dropped. This cancels the interval.
Examples
use Duration;
let duration = from_millis;
let interval = interval;
interval.tick .await; // ticks immediately
interval.tick .await; // ticks after 10ms
interval.tick .await; // ticks after 10ms
println!;