We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 90c67c2 commit dda65cbCopy full SHA for dda65cb
src/stream/stream/mod.rs
@@ -327,6 +327,8 @@ extension_trait! {
327
use async_std::stream;
328
use std::time::{Duration, Instant};
329
330
+ let start = Instant::now();
331
+
332
// emit value every 5 milliseconds
333
let s = stream::interval(Duration::from_millis(5))
334
.enumerate()
@@ -335,7 +337,6 @@ extension_trait! {
335
337
// throttle for 10 milliseconds
336
338
let mut s = s.throttle(Duration::from_millis(10));
339
- let start = Instant::now();
340
assert_eq!(s.next().await, Some((0, ())));
341
let duration_ms = start.elapsed().as_millis();
342
assert!(duration_ms >= 5);
0 commit comments