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 e5b28af commit c5a13ddCopy full SHA for c5a13dd
src/tools/miri/tests/pass/shims/time.rs
@@ -1,4 +1,5 @@
1
//@compile-flags: -Zmiri-disable-isolation
2
+#![feature(thread_sleep_until)]
3
4
use std::time::{Duration, Instant, SystemTime};
5
@@ -15,6 +16,14 @@ fn test_sleep() {
15
16
assert!((after - before).as_millis() >= 100);
17
}
18
19
+fn test_sleep_until() {
20
+ let before = Instant::now();
21
+ let one_second_from_now = before + Duration::from_millis(100);
22
+ std::thread::sleep_until(one_second_from_now);
23
+ let after = Instant::now();
24
+ assert!((after - before).as_millis() >= 100);
25
+}
26
+
27
fn main() {
28
// Check `SystemTime`.
29
let now1 = SystemTime::now();
@@ -49,4 +58,5 @@ fn main() {
49
58
duration_sanity(diff);
50
59
51
60
test_sleep();
61
+ test_sleep_until();
52
62
0 commit comments