summaryrefslogtreecommitdiffstats
path: root/tokio-test/src/clock.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio-test/src/clock.rs')
-rw-r--r--tokio-test/src/clock.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/tokio-test/src/clock.rs b/tokio-test/src/clock.rs
index 38417539..d2f29249 100644
--- a/tokio-test/src/clock.rs
+++ b/tokio-test/src/clock.rs
@@ -1,10 +1,9 @@
-//! A mocked clock for use with `tokio::timer` based futures.
+//! A mocked clock for use with `tokio::time` based futures.
//!
//! # Example
//!
//! ```
-//! use tokio::clock;
-//! use tokio::timer::delay;
+//! use tokio::time::{clock, delay};
//! use tokio_test::{assert_ready, assert_pending, task};
//!
//! use std::time::Duration;
@@ -23,8 +22,8 @@
//! ```
use tokio::runtime::{Park, Unpark};
-use tokio::timer::clock::{Clock, Now};
-use tokio::timer::Timer;
+use tokio::time::clock::{Clock, Now};
+use tokio::time::Timer;
use std::marker::PhantomData;
use std::rc::Rc;
@@ -125,13 +124,13 @@ impl MockClock {
where
F: FnOnce(&mut Handle) -> R,
{
- tokio::timer::clock::with_default(&self.clock, || {
+ tokio::time::clock::with_default(&self.clock, || {
let park = self.time.mock_park();
let timer = Timer::new(park);
let handle = timer.handle();
let time = self.time.clone();
- let _timer = tokio::timer::set_default(&handle);
+ let _timer = tokio::time::set_default(&handle);
let mut handle = Handle::new(timer, time);
f(&mut handle)
// lazy(|| Ok::<_, ()>(f(&mut handle))).wait().unwrap()